Coder Social home page Coder Social logo

pytea's Introduction

PyTEA

A Python implementation of the Tiny Encryption Algorithm, this is NOT a secure cipher, do not use it for anything important - it's just a fun toy. Can be used as a library, or via a cli.

TEA has a few weaknesses. Most notably, it suffers from equivalent keys—each key is equivalent to three others, which means that the effective key size is only 126 bits. As a result, TEA is especially bad as a cryptographic hash function. This weakness led to a method for hacking Microsoft's Xbox game console (where I first encountered it), where the cipher was used as a hash function. TEA is also susceptible to a related-key attack which requires 2^23 chosen plaintexts under a related-key pair, with 2^32 time complexity.

TODO

  • Does not currently implement CBC

CLI Usage

usage: tea.py [-h] [--encrypt EPATH] [--decrypt DPATH] [--verbose]

Python implementation of the TEA cipher

optional arguments:
  -h, --help            show this help message and exit
  --encrypt EPATH, -e EPATH
                        encrypt a file
  --decrypt DPATH, -d DPATH
                        decrypt a file
  --verbose             display verbose output

Library Usage

import tea

key = get_key('Random Text or Something')
cipher_text = tea.encrypt('somedata', key)
plaint_text = tea.decrypt(cipher_text, key)

pytea's People

Watchers

Boril Boyanov avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.