#archive #encryption #atom

atom-archive

Atom Fastest Archive Format

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

Download history 334/week @ 2025-03-28 731/week @ 2025-04-04 56/week @ 2025-04-11

1,121 downloads per month

MIT license

43KB
847 lines

Static Badge Static Badge Static Badge Static Badge

๐Ÿšจ 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?:

  1. 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.
  2. Uses Rayon & Tokio for full async + parallelism. Result? ๐Ÿ”ฅ Blazing-fast performance.
  3. Available as a Rust library and CLI (GUI coming soon ๐Ÿ‘€).

Why Atom?:

  1. Atom using full potentional of CPU.
  2. 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

  1. -c, --archive -> Set the archive file
  2. -a, --add ... -> Add files to the Files
  3. -r, --remove ... -> Remove files from the Files
  4. -u, --update-files ... -> Update the data block of the Files
  5. -x, --extract ... -> Extract files from the Files
  6. -e, --encrypt Encrypt the Files
  7. -p, --password -> Set the password for the Files
  8. -A, --algorithm <algorithm_set> -> Set the algorithm for the Files (Compression Alghorithm's: "lz4/zstd")
  9. -C, --compression <compression_level> -> Set the compression level for the Files
  10. -l, --list -> List the files in the archive
  11. -n, --new -> Creates archive file
  12. -N, --name-mapping -> Sets name mapping off (Increases Security)
  13. -P, --atomcrypte -> Sets AtomCrypte on/off (EXPERIMENTAL)
  14. -h, --help -> Print help
  15. -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:

  1. ๐Ÿšซ Game development โ€“ file loading can be slow
  2. ๐Ÿšซ With already compressed files (like .zip, .mp4, etc.)
  3. Huge files (1GB+) โ€“ works, but performance may suffer

โœ… When you should use Atom:

  1. โœ… Archiving large groups of small/medium files/large files (200MB+)
  2. โœ… Protecting archives with AES-256-GCM
  3. โœ… When you want parallel + async + Rust performance

๐Ÿงช Wanna try AtomCrypte?

  1. CLI (EXPERIMENTAL USE ONLY):
  • atom -c archive.atom -a myfile.txt -e -p "supersecret" -P
  1. Code (EXPERIMENTAL USE ONLY):
  •   set_encryption_algorithm(atom::EncryptionAlgorithms::ATOM)
    

Dependencies

~10โ€“17MB
~238K SLoC