Module encoding and encrypting text by key
Project description
TextBytesEncoder
Module encoding and encrypting text by key
Usage example
from textbytesencoder import Encoder
encoder = Encoder(key=None, save_key=False) # key: Optional[bytes] = None, save_key: Optional[bool] = False
print(encoder.encrypt(text)) # type(text) == str
print(encoder.decrypt(text)) # type(text) == bytes
During initialization, you can specify the optional key
parameter (key, type and purpose see below) and the optional save_key
parameter (saves the key to a separate file)
Parameters
Parameter key
of type bytes, generated using the Fernet.generate_key()
function
or using the base64.urlsafe_b64encode(os.urandom(32))
function used to encode or decode text.
print(encoder.key)
encoder.key = b"key" # key = Fernet.generate_key() or base64.urlsafe_b64encode(os.urandom(32))
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 Distribution
File details
Details for the file textbytesencoder-0.1.13.tar.gz
.
File metadata
- Download URL: textbytesencoder-0.1.13.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94f0abffa5b2fdb2d074051476680b971d8e1693bb35877da4a4c7cf151c205b |
|
MD5 | dde2b6e7295b6097c3b0c1781d0f5d0f |
|
BLAKE2b-256 | 9f08cb0bce78e0babfcd9440c97142c4560b91678bde36ff9075f87318449d04 |
File details
Details for the file textbytesencoder-0.1.13-py3-none-any.whl
.
File metadata
- Download URL: textbytesencoder-0.1.13-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9590eed30d70d5ab5d4ab7555d93ee6323961a0b87be5abea625ce79ae19afde |
|
MD5 | 4a95366d0feb5c3e72086747f7003de3 |
|
BLAKE2b-256 | 433fff39a6c7cb1487f28806361360bd5227999f9929698540e14c751d31231c |