#block

skip32

Fast 32-bit block cipher

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

Download history 182/week @ 2024-07-22 136/week @ 2024-07-29 186/week @ 2024-08-05 51/week @ 2024-08-12 61/week @ 2024-08-19 86/week @ 2024-08-26 143/week @ 2024-09-02 67/week @ 2024-09-09 119/week @ 2024-09-16 152/week @ 2024-09-23 151/week @ 2024-09-30 95/week @ 2024-10-07 102/week @ 2024-10-14 153/week @ 2024-10-21 93/week @ 2024-10-28 85/week @ 2024-11-04

435 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