Fast Format Preserving Encryption (FPE) implementation in Rust
Project description
fastfpe
Fast Format Preserving Encryption (FPE) implementation in Rust with Python bindings.
Format-preserving encryption (FPE) is a cryptographic method that encrypts data while preserving its format. For example, encrypting a credit card number yields another valid-looking credit card number, making it useful for data protection while maintaining compatibility with existing systems.
Features
- FF3-1 Format Preserving Encryption algorithm
- Fast Rust implementation with Python bindings
- Support for custom alphabets
- Thread-safe
Installation
pip install fastfpe
Usage
>>> from fastfpe import ff3_1
>>>
>>> key = "3eaa133d22a7ee2432fb8ecfde1e97d9106dcf26b9edaa52b3ed4acd9a9b8445"
>>> tweak = "5be49f26c1dbb7" # 7 bytes, hex-encoded
>>> alphabet = "abcdef0123456789"
>>> plaintext = "024587931578"
>>>
>>> # Encrypt
>>> ciphertext = ff3_1.encrypt(key, tweak, alphabet, plaintext)
>>> ciphertext
'd756b8704a2d'
>>> ff3_1.decrypt(key, tweak, alphabet, ciphertext)
'024587931578'
License
fastfpe is licensed under the MIT License. See LICENSE for more information.
fastfpe uses the rust-fpe library by johntyner under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastfpe-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fastfpe-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 297.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
088af65f649f8185071c27292846c0044fb0b2ffcbf1e9cb80e534564b58c7a9
|
|
| MD5 |
5ccf5262f419f067fc7169a8bb78ed64
|
|
| BLAKE2b-256 |
e63e90021dc988cced8af7a59ac70444b36e4a58234cac04d7489df148a4ca26
|
File details
Details for the file fastfpe-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fastfpe-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 297.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c68f968fb59b05a42c92bded6c9055de09ba0bce357d6cbd8ed0a383e2c704fa
|
|
| MD5 |
ca7359eccc3a2682e119f7c3831b6f13
|
|
| BLAKE2b-256 |
bacc597ae9297deff00faaa884a7013ab82add721a5c345f74659872a1e49011
|
File details
Details for the file fastfpe-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: fastfpe-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 297.2 kB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6182edadb0ebf4466525fa53ba13b675017b69e661aa25729724ea3bf86b5f83
|
|
| MD5 |
8e09d45db5bbacdcfc016bd03b0f7bea
|
|
| BLAKE2b-256 |
8afdcf006e072056473117437665cf44eded5d01f25a694e4d76b5c2a376d505
|