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.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b5917672f9a6b00a94b70a005e939f7c6dd8b76207f001476fd4bf8569278a |
|
MD5 | f1ce60e1d49649e572a3899454e869f7 |
|
BLAKE2b-256 | f7e9ce0e8ab9db7794dc2adf5a39ed771ba3d19b7347d92816dced340dbd799d |