#encryption #security

why2

Lightweight, fast, secure, and easy to use encryption system

29 releases (18 stable)

Uses new Rust 2024

1.4.12 Mar 14, 2026
1.4.11 Feb 19, 2026
1.4.10 Jan 26, 2026
1.3.5 Dec 28, 2025
0.2.3-rex Sep 30, 2025

#429 in Cryptography


Used in why2-chat

GPL-3.0-only

83KB
867 lines

WHY2

Build Status Codacy Badge Latest Version Docs Status

Lightweight, fast, secure, and easy to use encryption system.


Code Example

use why2::{ encrypter, decrypter };

fn main()
{
    let input = String::from("Hello world!");

    // Encrypt input using 8x8 Grid, with random key
    let encrypted = encrypter::encrypt_string::<8, 8>(&input, None)
                        .expect("Encryption failed");

    // Print encrypted Grids
    for grid in &encrypted.output
    {
        println!("{}", grid);
    }

    // Decrypt
    let decrypted = decrypter::decrypt_string(encrypted)
                        .expect("Decryption failed");

    // Compare input & output
    assert_eq!(input, *decrypted);
}

Getting Help

For help, DM me directly on Discord :)

Security Notice

WHY2 is an experimental symmetric encryption algorithm. While it employs proven cryptographic techniques (SPN structure, ARX operations, MDS mixing), it has not been formally audited or peer-reviewed.

License

WHY2 is licensed under the GNU GPLv3. You are free to use, modify, and redistribute it under the terms of the license. See https://www.gnu.org/licenses/ for details.

Dependencies

~5MB
~103K SLoC