Fast Fernet bindings for Python
Project description
rfernet
Python extension for Fernet encryption/decryption, faster than other alternatives.
This library uses the rust library fernet-rs https://github.com/mozilla-services/fernet-rs.
CI & Building wheels copied from cryptography and orjson
Benchmark
Compared to cryptography's Fernet (CPU):
In [2]: from cryptography.fernet import Fernet as cFernet
In [3]: from rfernet import Fernet as rFernet
In [4]:
In [4]: plain = b"asd" * 1000
In [5]: key = rFernet.generate_new_key()
In [7]: r_fernet = rFernet(key)
In [8]: c_fernet = cFernet(key)
In [9]: %timeit r_fernet.encrypt(plain)
18.4 µs ± 117 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
In [10]: %timeit c_fernet.encrypt(plain)
77.7 µs ± 921 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
Memory:
# rfernet
[ Top 10 ]
<frozen importlib._bootstrap>:219: size=4444 B, count=38, average=117 B
test2.py:4: size=576 B, count=1, average=576 B
<frozen importlib._bootstrap_external>:59: size=156 B, count=1, average=156 B
test2.py:6: size=93 B, count=1, average=93 B
<frozen importlib._bootstrap>:371: size=80 B, count=1, average=80 B
<frozen importlib._bootstrap>:105: size=72 B, count=1, average=72 B
<frozen importlib._bootstrap_external>:1352: size=56 B, count=1, average=56 B
<frozen importlib._bootstrap_external>:606: size=56 B, count=1, average=56 B
test2.py:7: size=48 B, count=1, average=48 B
<frozen importlib._bootstrap_external>:1030: size=40 B, count=1, average=40 B
# cryptography's Fernet
[ Top 10 ]
<frozen importlib._bootstrap_external>:525: size=3134 KiB, count=31814, average=101 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py:91: size=449 KiB, count=3169, average=145 B
<frozen importlib._bootstrap>:219: size=404 KiB, count=3384, average=122 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/abc.py:126: size=146 KiB, count=717, average=209 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py:89: size=119 KiB, count=1773, average=69 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/abc.py:127: size=68.7 KiB, count=447, average=157 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/inspect.py:2793: size=46.8 KiB, count=282, average=170 B
<frozen importlib._bootstrap_external>:59: size=41.7 KiB, count=265, average=161 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/abc.py:135: size=40.8 KiB, count=339, average=123 B
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/idna/idnadata.py:826: size=36.7 KiB, count=3, average=12.2 KiB
Memory test source code:
import tracemalloc
tracemalloc.start()
from cryptography.fernet import Fernet as cFernet
plain = b"asd" * 1000
key = cFernet.generate_key()
c_fernet = cFernet(key)
c_fernet.encrypt(plain)
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
print("[ Top 10 ]")
for stat in top_stats[:10]:
print(stat)
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 Distribution
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 rfernet-0.3.5.tar.gz.
File metadata
- Download URL: rfernet-0.3.5.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07e98fc5d2a5ae6af4b529f113197c5f0c7bce7f03fdbd4d4f764ab27ac949f6
|
|
| MD5 |
614e160289c673254bb3e158778fbcf4
|
|
| BLAKE2b-256 |
da29109469a60a4724a7014f7b95b72b5cb82556a9660b86e5a2b00de9e80eb1
|
File details
Details for the file rfernet-0.3.5-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b230d8167679c4c576086892f8ad71b4d30cddb011dd74572c9a213903d94e7a
|
|
| MD5 |
119fc3d999bd4f6501d39317ec65d70d
|
|
| BLAKE2b-256 |
f315ab2f5e1411cf9c03cc51229d23ee61e687d7c1effba95dba70c1df819411
|
File details
Details for the file rfernet-0.3.5-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c487bc3b81fcb18c3f281808ea23dcb1bbc430911f693dd9284bde6f52cd2d43
|
|
| MD5 |
3c7560a5f0c7294eda33c0497c8472a7
|
|
| BLAKE2b-256 |
470384035d440617be512b39fc8674482c2ac51d4dbc292b04672909aeced404
|
File details
Details for the file rfernet-0.3.5-cp313-cp313-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp313-cp313-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57ac9481353d1f19d3433369ebde53cab1f7ff4928b891dae13fb44c64a11d20
|
|
| MD5 |
863360055c99f5c7c4897af36a43b1a0
|
|
| BLAKE2b-256 |
893a0e6f9ee749a662e62cc20bff7e54b58e4f65fb924a1d39df43792aebaa23
|
File details
Details for the file rfernet-0.3.5-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 212.1 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a11ae44a8bf52a6c654ae4c83c0f87b3edaaf38484303bc753994f0d9bbaf08
|
|
| MD5 |
eaa9e7d73f31c8c242374ddc1456d900
|
|
| BLAKE2b-256 |
c7b5032e439b9a96cd8e7472e8b68f727bcaa01df5e8ef446cea73210b8e4589
|
File details
Details for the file rfernet-0.3.5-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed5aecc89ea4dc255619954113a510b2ef67956cfab9c4f1f5ed558d9e8539fa
|
|
| MD5 |
e4215ee52526167d5de72394476904e9
|
|
| BLAKE2b-256 |
977ee20fa5f8ee38d0e453e39fd4deef79ffc1e7865ebee3829368d09009ce87
|
File details
Details for the file rfernet-0.3.5-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b11cc5dc00d45230cdb8a10021da4bb2bca787a1af3e8e18d7c9ab016ca592b
|
|
| MD5 |
853ddf4922c60c5292de1eaf1af4188e
|
|
| BLAKE2b-256 |
bc4eb62d235aff82eef3523af5510cc99db76e080330217410117eaf792afe00
|
File details
Details for the file rfernet-0.3.5-cp312-cp312-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp312-cp312-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbd0d4bbd43707ede2474a42c1aeb7172b7d0f24c0751dc435cea1406d889d21
|
|
| MD5 |
5529cc603bc4058b9261f2a1d73aecb1
|
|
| BLAKE2b-256 |
c455521277903015ab38a200a450e1a383308d245f83a446f929f454697ff70e
|
File details
Details for the file rfernet-0.3.5-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 211.8 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fad62b0a16d83c6662cb8ac56fdd573172dc393b1ee45a5c391c5ed20df7a34
|
|
| MD5 |
0795f43bb6d67b0966d7a089fe0d03d2
|
|
| BLAKE2b-256 |
723d58e5c3ea9c3a6fa071725d936837e7d21dbdf03bc1a1fc36aba591880aef
|
File details
Details for the file rfernet-0.3.5-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2b967010b13cd782935845a26db3f01b9d12d2ab587f80b397c6ebc292cbe85
|
|
| MD5 |
70c483ebb6a9c7cb077716d2c0007ab5
|
|
| BLAKE2b-256 |
2531c1cbc580fd7253c12b44553c0307e17e9159ba1edc8a2fc1809c56cddeed
|
File details
Details for the file rfernet-0.3.5-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff4a0b307416ee5b01019a6204b27cbebd01598dcc473d8bedc9a3a189c0abb
|
|
| MD5 |
57f1c69b0116a090f5b39f67a013cfa2
|
|
| BLAKE2b-256 |
dbd12ec9c7e927d29eb2458bf4de224d269fbc13c073a955a7b87342c0dd09a6
|
File details
Details for the file rfernet-0.3.5-cp311-cp311-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp311-cp311-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6678990086a2355894a399f51ae09d52afae712852eea76db5fc7928ece9c529
|
|
| MD5 |
d92aaa9e7a03cadb208696245aca068a
|
|
| BLAKE2b-256 |
16362ae954d3cd8cc916154a91c9b5b59348762b2b04cf4ca544ff3dacba659a
|
File details
Details for the file rfernet-0.3.5-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 214.1 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71a33c229ac8a55c5645e0e37a6914203141df682f5d7040cc4d66ff1ae707fb
|
|
| MD5 |
56476be084f9b51ba8d81492c85b2deb
|
|
| BLAKE2b-256 |
db19d99d0a25cc125e96d1f754791d01b6cf767377814cadbed340c0c38d42ac
|
File details
Details for the file rfernet-0.3.5-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d1f84b6d0719a28a895e9f78ee56fd73cc15b0ea7c73684f571170e2de2d3cf
|
|
| MD5 |
e32e38dbb7b555234c2883b900925f6a
|
|
| BLAKE2b-256 |
e62e08e15960964403c67b768c279298df2e0ca6afa60f74d72dc5bc28eb54ef
|
File details
Details for the file rfernet-0.3.5-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2df32cc93f7f405564f0fd5e9456f33b91562c04e802c08b9b8e488bb864ecf
|
|
| MD5 |
14a61d1a9a5fd8c5e359f4e2a70da9cb
|
|
| BLAKE2b-256 |
f83d1f76113b7eacc21ae226381a3f4344183a5fd81b1d1fe4c6ef79524b6b16
|
File details
Details for the file rfernet-0.3.5-cp310-cp310-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp310-cp310-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1780fa5049a2d7f227baed8bf04a34a2cbb2e324e96c9812b2adadf437485d80
|
|
| MD5 |
6c60aca1e1f4d741e481c840ba94c45d
|
|
| BLAKE2b-256 |
77e9471074c2bcdb82b782d3c0ce591cae428ad348a63ce6d8ee92a29c8da9fe
|
File details
Details for the file rfernet-0.3.5-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 214.7 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1051ce3f1746a45033d4e0773796ecd28007c2af82b95e63cbd8a426600d59e4
|
|
| MD5 |
400bf9fb251da4641e723fd3b208c6a4
|
|
| BLAKE2b-256 |
8df582db9c9eff341f54bc415341f92790ce090cb7b94c34d416ded07b59fbe6
|
File details
Details for the file rfernet-0.3.5-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44d2a9284c24559b784d5891461202b0cad2a1b33040cb598554e25c5584f977
|
|
| MD5 |
da72200b710d7a91c371b34719449d90
|
|
| BLAKE2b-256 |
18eb62697d6052ebf1ab4830d6d9cf4d7177961a023862feffa15f5b306429e4
|
File details
Details for the file rfernet-0.3.5-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0e50dd2cd80d281fdd994f47298c44092b7f1621fb8664e0127b082f0b81aa1
|
|
| MD5 |
3f8416bfb138e811971dc5d409d09e71
|
|
| BLAKE2b-256 |
90b7373c9d83adc7633ba6724eb34a4f937c6597363848c9185f9cffa9f5ab39
|
File details
Details for the file rfernet-0.3.5-cp39-cp39-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp39-cp39-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ba3e8896601fb9f108824da3878488bd8cffc98a120eb6e0407fd56bb1358a5
|
|
| MD5 |
733f8d457cc35289473c1040711e8b9c
|
|
| BLAKE2b-256 |
50e085dae66331a3a3eba32dda8baf12c7360a82676c4e6b4c9aa04a9cc84288
|
File details
Details for the file rfernet-0.3.5-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: rfernet-0.3.5-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 214.8 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee6ef424cf611bb9ad9f3a4f2ac61831fc80b1d8eb3aeefe3aff0725a665ff7e
|
|
| MD5 |
9bc75c0140f5b490d812523810b226f2
|
|
| BLAKE2b-256 |
08145cf2bd90bba3bf629f870c5a0d43a7cf4bff83512bded5d7b91f178d920c
|