12 stable releases
Uses new Rust 2024
1.3.7 | Apr 7, 2025 |
---|---|
1.3.6 | Apr 6, 2025 |
1.0.1 | Mar 31, 2025 |
#320 in Cryptography
1,121 downloads per month
43KB
847 lines
๐จ EXPERIMENTAL FEATURE: AtomCrypte.
โ ๏ธ AtomCrypte is extremely fast on small files, but NOT RECOMMENDED FOR PRODUCTION USE โ potential security weaknesses exist.
๐ AES-256 remains the default encryption algorithm.
What is Atom?:
- Atom is a file archive tool like RAR or ZIP โ but different. Instead of scanning the whole archive, it locates and operates on specific files.
- Uses Rayon & Tokio for full async + parallelism. Result? ๐ฅ Blazing-fast performance.
- Available as a Rust library and CLI (GUI coming soon ๐).
Why Atom?:
- Atom using full potentional of CPU.
- Supports both LZ4 and ZSTD โ pick between raw speed or tighter compression.
๐ Compression Benchmarks (Without Encryption)
Algorithms | LZ4 | ZSTD (0) |
---|---|---|
400MB .exe | ~1.5 Seconds | ~2 Seconds |
200MB .exe | ~700 MS | ~1 Seconds |
100MB .exe | ~250 MS | ~500 MS |
๐ Decompression Benchmarks (Without Encryption)
Algorithms | LZ4 | ZSTD (0) |
---|---|---|
400MB .exe | ~200 MS | ~800 MS |
200MB .exe | ~150 MS | ~350 MS |
100MB .exe | ~100 MS | ~200 MS |
๐งช CLI Flags
- -c, --archive -> Set the archive file
- -a, --add ... -> Add files to the Files
- -r, --remove ... -> Remove files from the Files
- -u, --update-files ... -> Update the data block of the Files
- -x, --extract ... -> Extract files from the Files
- -e, --encrypt Encrypt the Files
- -p, --password -> Set the password for the Files
- -A, --algorithm <algorithm_set> -> Set the algorithm for the Files (Compression Alghorithm's: "lz4/zstd")
- -C, --compression <compression_level> -> Set the compression level for the Files
- -l, --list -> List the files in the archive
- -n, --new -> Creates archive file
- -N, --name-mapping -> Sets name mapping off (Increases Security)
- -P, --atomcrypte -> Sets AtomCrypte on/off (EXPERIMENTAL)
- -h, --help -> Print help
- -V, --version -> Print version
How to use:
use atom::*;
#[tokio::main]
async fn main() {
set_algorithm(atom::Algorithms::ZSTD).unwrap();
set_password("testpassword").unwrap();
set_zstd_compression_level(10).unwrap();
set_name_mapping(false).unwrap();
set_encryption_algorithm(atom::EncryptionAlgorithms::AES)
let (hash_file_name, file_name) = get_file_names().await.unwrap(); // only works when mapping enabled
add_data_block(vec!["test.txt" /* ... */], "test", false).await.unwrap();
remove_data_block(vec!["test.txt" /* ... */], "test").await.unwrap();
export_file(vec!["test.txt" /* ... */], "test").await.unwrap();
read_data_block("test.txt", "test").await.unwrap();
read_multiple_data_block(vec!["test.txt" /* ... */], "test").await.unwrap();
update_data_block(vec!["test.txt" /* ... */], "test", false).await.unwrap();
}
Which case you should use and you shouldn't use:
โ ๏ธ When not to use Atom:
- ๐ซ Game development โ file loading can be slow
- ๐ซ With already compressed files (like .zip, .mp4, etc.)
- Huge files (1GB+) โ works, but performance may suffer
โ When you should use Atom:
- โ Archiving large groups of small/medium files/large files (200MB+)
- โ Protecting archives with AES-256-GCM
- โ When you want parallel + async + Rust performance
๐งช Wanna try AtomCrypte?
- CLI (EXPERIMENTAL USE ONLY):
atom -c archive.atom -a myfile.txt -e -p "supersecret" -P
- Code (EXPERIMENTAL USE ONLY):
-
set_encryption_algorithm(atom::EncryptionAlgorithms::ATOM)
Dependencies
~10โ17MB
~238K SLoC