Skip to content
Varbin edited this page Jul 12, 2014 · 7 revisions

XTEA in Python

XTEA-Cipher in Python (eXtended Tiny Encryption Algorithm)

XTEA is a blockcipher with 8 bytes blocksize and 16 bytes Keysize (128-Bit). The algorithm is secure at 2014 with the recommend 64 rounds (32 cycles). This implementation supports following modes of operation: ECB, CBC, OFB, CFB, CTR (buggy), CFB will be added soon.

Example:

>>> from xtea import *
>>> key = " "*16  # Never use this
>>> text = "This is a text. "*8
>>> x = new(key, mode=MODE_OFB, IV="12345678")
>>> c = x.encrypt(text)
>>> text == x.decrypt(c)
True

You find the documentation at https://github.com/Varbin/xtea/wiki/Documentation

Note

I does NOT guarantee that this implementation (or the base cipher) is secure. If there are bugs, tell me them.

Changelog

Version 0.2.1 - dev; Jul 10, 2014 to Jul 11, 2014

[0.2.1] Minor changes and wheels

  • Added upload.py (not on pypi/warehouse)
  • Added better wheel support for uploading (just for me) with a setup.cfg
  • Added this changelog (auto uploading on pypi/warehouse and github)

Version 0.2.0; Jul 9, 2014

[0.2.0] Added a test feature; warning in CTR

  • Added a test feature
  • Raises warning on CTR, added a handler that CTR will not crash anymore ;)

Version 0.1.1; Jul 9, 2014

[0.1.1] NotImplementedError on CFB

  • Module raises a NotImplementedError on CFB
  • Minor changes

Version 0.1; Jun 22, 2014

[0.1] Initial release

  • Supports all mode except CFB
  • Buggy CTR ( "ß" = "\xc3\x9f" )
  • Working with PEP 272, default mode is ECB
Clone this wiki locally