7 releases (stable)
Uses old Rust 2015
1.0.5 | Oct 11, 2019 |
---|---|
1.0.4 | Mar 24, 2017 |
1.0.2 | Dec 9, 2015 |
0.1.1 | Apr 29, 2015 |
#102 in #block
435 downloads per month
5KB
lib.rs
:
SKIP32 is a 80-bit key, 32-bit block cipher based on SKIPJACK.
It has the uncommon properties of being fast, creating very dissimilar encrypted values for consecutive input values, and producing output of the same size as the input (32-bit). These make this cipher particularly useful for obfuscating series of 32-bit integers (e.g. auto-incremented database ids). It is not appropriate for general cryptography.
See CPAN - Crypt::Skip32 for more information.
Example
let key: &[u8; 10] = &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let input = 1000;
let encoded = skip32::encode(key, input);
let decoded = skip32::decode(key, encoded);
assert!(encoded == 2109307140);
assert!(decoded == input);