Chacha20poly1305
Simple pure-python chacha20-poly1305 implementation based on tlslite-ng code. Designed to be compatible with Cryptography API.
import os
from chacha20poly1305 import ChaCha20Poly1305
key = os.urandom(32)
cip = ChaCha20Poly1305(key)
nonce = os.urandom(12)
ciphertext = cip.encrypt(nonce, b'test')
plaintext = cip.decrypt(nonce, ciphertext)
print(plaintext)
Pip
pip install chacha20poly1305
Note
Please note the pure python implementation probably suffers form side-channels leakage (timing, memory access). For constant time implementations use compiled versions:
Release files for chacha20poly1305 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chacha20poly1305-0.0.3.tar.gz | 5.1 kB | Details |
Release files / chacha20poly1305-0.0.3.tar.gz
| Download URL | chacha20poly1305-0.0.3.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2f005c7cf4638ffa4ff06c02c78748068b642916795c6d16c7cc5e355e70edf
|
|
BLAKE2b-256 checksum How to use checksums |
382c5b4eb73c5cb30ded3082af025e76f529764971c57c02b101e842ff998f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|