Skip to main content

Python package for the Tiny Encryption Algorithm (TEA).

Project description

Herbal TEA

Gitlab MIT License Python Version Code Style Pipeline Code Coverage

Python package for the Tiny Encryption Algorithm (TEA).

The Tiny Encryption Algorithm (TEA) is a simple and efficient block cipher algorithm.

Features

  • Supports Python 3.9+.
  • Simple typed Python API.
  • No third-party dependencies.
  • Uses scrypt to derive encryption keys.
  • Allow for input text of any length with PKCS#7 padding.

Installation

# Latest stable release.
pip install herbal
# Most recent (unstable) release.
pip install git+https://gitlab.com/lunardev/herbal.git

Usage

from herbal.tea import encrypt, decrypt

password = "secret"
cipher = encrypt("example message!", password=password)
plain = decrypt(cipher, password=password)
print(plain)  # example message!

To-Do

  • Implement the Tiny Encryption Algorithm.
  • Add padding to plaintext input.
    • [~] ISO 10126
    • PKCS#7
  • Implement extended algorithms.
    • XTEA
    • XXTEA
  • Add different block ciper modes.
    • Electronic Code Book (ECB)
    • Cipher Block Chaining (CBC)
    • Cipher Feedback Mode (CFB)
    • Output Feedback Mode (OFB)
    • Counter Mode (CTR)
  • Add error handling for bad data.
  • Add unit tests.
    • Local pytest cases
    • GitLab CI pipeline
    • Code coverage
  • Write documentation.
  • Publish project to the Python Package Index.

References

  1. Wheeler, David J.; Needham, Roger M. TEA, a Tiny Encryption Algorithm. 16 Dec. 1994 https://link.springer.com/content/pdf/10.1007/3-540-60590-8_29.pdf.
  2. Shepherd, Simon. The Tiny Encryption Algorithm (TEA). https://www.tayloredge.com/reference/Mathematics/TEA-XTEA.pdf.
  3. Andem, Vikram Reddy. A Cryptanalysis of the Tiny Encryption Algorithm, 2003, https://tayloredge.com/reference/Mathematics/VRAndem.pdf.
  4. Wikipedia. Tiny Encryption Algorithm, 6 Nov. 2023, https://wikipedia.org/wiki/Tiny_Encryption_Algorithm.
  5. Fandom. Tiny Encryption Algorithm, 24 Sept. 2010, https://antifandom.com/cryptography/wiki/Tiny_Encryption_Algorithm.

License

This project is licensed under the MIT License. Copyright (c) 2024.

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

herbal-0.1.3.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

herbal-0.1.3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file herbal-0.1.3.tar.gz.

File metadata

  • Download URL: herbal-0.1.3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.6.9-200.fc39.x86_64

File hashes

Hashes for herbal-0.1.3.tar.gz
Algorithm Hash digest
SHA256 82b78a9e649d57f53c3f33c420f575d06720044fdfbfe1406455f81598da75f5
MD5 e2a926282b2792d0f65ef2ec5d9a0dee
BLAKE2b-256 877cbe895195c1eb2695950b0ade65a042617f7f1cce7757cdaa7f9c5ba0191e

See more details on using hashes here.

File details

Details for the file herbal-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: herbal-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.6.9-200.fc39.x86_64

File hashes

Hashes for herbal-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d709f4fe2d606329b1863723010e0e8f083a1362c2c63e75d2efb01b87dcd712
MD5 4a13f21f6f444491dfbe6302b194c9ca
BLAKE2b-256 eecc0d3ac5b6ede396ba9752270c7f88db4d5e15addca4fdf3a4e0a479e1217e

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