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

#2304 in Cryptography

Download history 48/week @ 2024-03-16 43/week @ 2024-03-23 77/week @ 2024-03-30 79/week @ 2024-04-06 111/week @ 2024-04-13 236/week @ 2024-04-20 321/week @ 2024-04-27 123/week @ 2024-05-04 167/week @ 2024-05-11 114/week @ 2024-05-18 151/week @ 2024-05-25 69/week @ 2024-06-01 154/week @ 2024-06-08 199/week @ 2024-06-15 144/week @ 2024-06-22

507 downloads per month

MIT license

5KB

Crates.io


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);

No runtime deps