Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textbytesencoder-0.1.13.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

textbytesencoder-0.1.13-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for textbytesencoder-0.1.13.tar.gz
Algorithm Hash digest
SHA256 94f0abffa5b2fdb2d074051476680b971d8e1693bb35877da4a4c7cf151c205b
MD5 dde2b6e7295b6097c3b0c1781d0f5d0f
BLAKE2b-256 9f08cb0bce78e0babfcd9440c97142c4560b91678bde36ff9075f87318449d04

See more details on using hashes here.

File details

Details for the file textbytesencoder-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for textbytesencoder-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 9590eed30d70d5ab5d4ab7555d93ee6323961a0b87be5abea625ce79ae19afde
MD5 4a95366d0feb5c3e72086747f7003de3
BLAKE2b-256 433fff39a6c7cb1487f28806361360bd5227999f9929698540e14c751d31231c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page