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

#1744 in Cryptography

Download history 32/week @ 2023-11-25 73/week @ 2023-12-02 76/week @ 2023-12-09 80/week @ 2023-12-16 13/week @ 2023-12-23 65/week @ 2023-12-30 52/week @ 2024-01-06 63/week @ 2024-01-13 77/week @ 2024-01-20 46/week @ 2024-01-27 86/week @ 2024-02-03 76/week @ 2024-02-10 90/week @ 2024-02-17 117/week @ 2024-02-24 68/week @ 2024-03-02 29/week @ 2024-03-09

319 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