leona
Implementation of
LIONESS
in Rust. Works with no_std and generic over hashes/ciphers.
☣️ Cryptographic hazmat ☣️
This crate is not battle tested and not audited. It exists as a learning exercise. Use it at your own risk.
LIONESS
LIONESS is a wide block cipher, constructed using a hash algorithm and a stream cipher. From the paper:
Each ciphertext bit depends on all the plaintext bits in a very complex way, which contributes to the cryptographic strength.
Example use
You need a hash algorithm and a compatible stream cipher (compatible means that the hash output has the same size as the stream cipher key):
use ;
use Blake2sMac256;
use ChaCha20;
type Cipher = ;
let mut data = ;
data.copy_from_slice;
let cipher = new_dynamic;
cipher.encrypt;
assert_ne!;
cipher.decrypt;
assert_eq!;
Alternatives
There are two drawbacks to LIONESS:
- It is slow.
- It cannot encrypt short messages (shorther than the hash output size).
If you require a wide block cipher, consider using a different construction (like aez via aez or zears).
License
This crate is licensed under the terms of the MIT license. You can find the full license text in LICENSE.