Registry / crypto / fpe
library0.6.1rscratesunverified

Format-preserving encryption (FPE) implementation in Rust.

# Cargo.toml [dependencies] fpe = "0.6.1"
INSTALL
IMPORT
SIG · FPE
F
fpe
cryptorustv0.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FF1
use fpe::ff1::FF1;

Encrypt a numeric string using FF1 mode format-preserving encryption.

use fpe::ff1::{FF1, BinaryNumeralString}; let key = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"; let ff1 = FF1::new(&key, 10).unwrap(); let plaintext = BinaryNumeralString::from_str("1234567890").unwrap(); let ciphertext = ff1.encrypt(&[], &plaintext).unwrap();
Debug
Known issues
gotchaRequires careful handling of tweak and radix parameters; incorrect usage can weaken security.
fix
Always validate radix and ensure tweak is properly derived for your use case.
affects: >=0.6.0
Upgrade
Version history
0.6.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
fpe — cargo add fpe · libregistry