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
Close
Hashes for textbytesencoder-0.1.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9590eed30d70d5ab5d4ab7555d93ee6323961a0b87be5abea625ce79ae19afde |
|
MD5 | 4a95366d0feb5c3e72086747f7003de3 |
|
BLAKE2b-256 | 433fff39a6c7cb1487f28806361360bd5227999f9929698540e14c751d31231c |