#cipher #payload #const #aes

const-ciphers

Ciphers implemented as constant expressions in Rust for use in payload generation. Not for regular use.

5 releases

new 0.0.5 Dec 18, 2024
0.0.4 Dec 18, 2024
0.0.3 Dec 18, 2024
0.0.2 Dec 18, 2024
0.0.1 Dec 18, 2024

#11 in #payload

25 downloads per month

MIT license

42KB
1K SLoC

Const ciphers

Installation

cargo add const-ciphers

Usage

use const-ciphers::{AesConst, AesMode};

const fn example() {
    let plaintext = [0u8; 32];
    let key = [0xFF; 16];
    let iv = [0x00; 16];
    let mode = AesMode::CBC { iv };

    let encrypted = AesConst::encrypt(&plaintext, &key, &mode);
    let decrypted = AesConst::decrypt(&encrypted, &key, &mode);
}

Disclaimer

⚠️ Caution
Not for cryptographic use. No cryptographic properties guaranteed. Only use for payload generation.

Dependencies

~14KB