Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fastfpe-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (297.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fastfpe-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (297.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

fastfpe-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (297.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

fastfpe-0.1.0-1-cp312-cp312-manylinux_2_34_x86_64.whl (297.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

fastfpe-0.1.0-1-cp311-cp311-manylinux_2_34_x86_64.whl (297.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

fastfpe-0.1.0-1-cp310-cp310-manylinux_2_34_x86_64.whl (297.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file fastfpe-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fastfpe-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6a21aa2286fc6fcdcc6b16cc0cc7feeca59208df9b8d79103f8497e40551665b
MD5 3b61b20e77c8f0a5b9125eedb1691217
BLAKE2b-256 560622208a0a38f2ef68327962f442268c726f6a237caa842d2a544da91b98b3

See more details on using hashes here.

File details

Details for the file fastfpe-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fastfpe-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 77bc3ab529d99d2ebe1b4474075d5422ca0292e99dda8be2a557441ea72699fd
MD5 4411720bab3b5c0042a1ac46a5d252a4
BLAKE2b-256 c27d749f8010462450f44d9963b3bae92af2c2e3a4f478202b9dd3d19014518d

See more details on using hashes here.

File details

Details for the file fastfpe-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fastfpe-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e1d58ff1c1fc17f96cac22c506540f57532dfacb131108f2b5039f4de53ca6e2
MD5 daa1e43a75a9240eebcd85b7969deeca
BLAKE2b-256 47ddd1b204a9d5ff899dc032166fee98203f8db56cfbcf7d554e5027ef86cce9

See more details on using hashes here.

File details

Details for the file fastfpe-0.1.0-1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fastfpe-0.1.0-1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 529f0ff1afb269258b788722376586c52bdbc322d7f2973c9cf6793452e4e29d
MD5 5c6b9915e0df1c5ee03370d611b5c663
BLAKE2b-256 664cde0e2a05401e00d987b3ef36ac65e36c4f2b4ba99d5ba3af0bd750871b30

See more details on using hashes here.

File details

Details for the file fastfpe-0.1.0-1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fastfpe-0.1.0-1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9fa6c263decd180e521f7805e3fed80a726a0d5bff8369321c28320e96a6f4a9
MD5 8cac7638b1a0516ef3e3a68058c9cce1
BLAKE2b-256 7715b2c02ab00a983619368fa6dab535b523471e18dd5a6ca5681c9b0a16335e

See more details on using hashes here.

File details

Details for the file fastfpe-0.1.0-1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for fastfpe-0.1.0-1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8f274593b9d1cbb511679d46ff47a4bde58dfda4ea99058c6ecc4f8308b89467
MD5 7820de9283679b926718546e18b25d9e
BLAKE2b-256 ad9460d5e9be5f7e6ba5947839ca0becaedcb6ae3ca3f88062279946bfe14891

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page