A python version of XTEA
Project description
This is an XTEA-Cipher implementation 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, CFB, OFB, CTR
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
Resources
Source code: https://github.com/varbin/xtea
Issue tracker: https://github.com/varbin/xtea/issues
Changelog
Version 0.7.1, former 0.6.1 / 0.7.0; Jun 16, 2018
Improved tests
PEP8-style formatting
Unittests: Counter, modes (but not results of them!), test vectors
[BREAKING CHANGE] Counter class is now in xtea.counter
Python 3.3 is not tested anymore on Travis CI
[BREAKING CHANGE] CFB mode is now correctly implemented. By setting partition_size it is possible to set the internal partition size (in bits) as per PEP-272.
Python 3: An optional C extension improves speed upto a factor of 10.
[BREAKING CHANGE] block_size and key_size is now in bytes.
Skipped 0.7.0 with
(unreleased) Version 0.6.0; Oct 16, 2016
Python 3 does work now
[BREAKING CHANGE] counters cannot return numbers any more, they must return bytestrings now
[BREAKING CHANGE] Cipher objects remember state, so two consecutive calls to XTEACipher.encrypt should not return the same
improved documentation
(unreleased) Version 0.5.0; Oct 15, 2016
Removed CBCMAC
Version 0.4.1; Jul 30, 2015
Fixed installer
Version 0.4.0; Jul 12, 2014
Buggless & PEP compliant CTR
CTR mode works with strings now
raises DeprecatedWarning if a number is returned
CBCMAC class added (use static method CBCMAC.new(args) to create)
Version 0.3.2; Jul 11, 2014
Minor Fixes
Version 0.3.1; Jul 11, 2014
Minor Fixes
Fixed that the length of data will not be checked
Version 0.3.0; Jul 11, 2014
Added CFB mode
Fully working with PEP 272
Raising NotImplementedError only on PGP-CFB (OpenPGP) mode
Wheel support and changelog (0.2.1)
(unreleased) Version 0.2.1 - dev; Jul 10, 2014
Added better wheel support for uploading (just for me) with a setup.cfg
Added this file (auto uploading on pypi/warehouse and github)
(upload.py for github)
Version 0.2.0; Jul 9, 2014
Added a test feature; warning in CTR
Raises warning on CTR, added a handler that CTR will not crash anymore ;)
Version 0.1.1; Jul 9, 2014
Module raises a NotImplementedError on CFB
Minor changes
Version 0.1; Jun 22, 2014
Initial release
Supports all mode except CFB
Buggy CTR ( “ß” = “\xc3\x9f” )
Working with PEP 272, default mode is ECB
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
Built Distributions
File details
Details for the file xtea-0.7.1.tar.gz
.
File metadata
- Download URL: xtea-0.7.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61f770d4d089f2aba42d4dc888fde98688b7d76af5ae50116b9ec53161e160ab |
|
MD5 | 851d54bb20ac73aef8eacdf4ff05869f |
|
BLAKE2b-256 | 50f5834b9ee6ce7b2c53ff058a19029510cf5420585b3b1ae6fe8b6b0146a84f |
File details
Details for the file xtea-0.7.1-py2.py3-none-any.whl
.
File metadata
- Download URL: xtea-0.7.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d02406d375faa57f6bd017c17aa70e02cfbd565f9060e44bfe8cb4cbfec7e2 |
|
MD5 | 80ee3bcf855072f31251cf5816e0445f |
|
BLAKE2b-256 | 9ea29c1af8d6b2636888ee26d7292aa97ea7ad83d45da81d386817eacebbac09 |
File details
Details for the file xtea-0.7.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: xtea-0.7.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 12.3 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a24c1aa4bed085d9b35b75ee31790ec71ef2992b8007f7203c0da4911fd31c34 |
|
MD5 | dc20b3deceda097b247bce1fe2863b65 |
|
BLAKE2b-256 | ce7404336e26549ca8457947273aeb22d12225141fe2175678fb089b0986c2b3 |
File details
Details for the file xtea-0.7.1-cp37-cp37m-win32.whl
.
File metadata
- Download URL: xtea-0.7.1-cp37-cp37m-win32.whl
- Upload date:
- Size: 11.6 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a591c8b19732004f8dddafb0dc9d5098d3f650de2df1f2bcf56c0a93e451a96 |
|
MD5 | 3c0fdea88734fae367134b336c848e50 |
|
BLAKE2b-256 | 491d671ba3b9988c8d65cf8e23a5a013b5a83fcd2955789c70668de6557e0af3 |
File details
Details for the file xtea-0.7.1-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: xtea-0.7.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 12.3 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27b0c0a242318cf72fdc9fc2a257e60bf75ba075861b77fcb7f80e8381615c70 |
|
MD5 | 1fa1f8440a3f8e201a97d74889ab5434 |
|
BLAKE2b-256 | ef332abea3ac604f109cb16a25befd52504cdf4ad84360e872b7a3531ef271c0 |
File details
Details for the file xtea-0.7.1-cp36-cp36m-win32.whl
.
File metadata
- Download URL: xtea-0.7.1-cp36-cp36m-win32.whl
- Upload date:
- Size: 11.6 kB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 876e6af9ba01805c08bd4b8ad6346c08889fe6727506f17de15b390e18042ffc |
|
MD5 | 53779ee3c830bb79105fcd5ac2186c8c |
|
BLAKE2b-256 | c900d9bc84b9a08b610fbae6cc76e9dfecfcc408f387271c46998b3165ef424b |
File details
Details for the file xtea-0.7.1-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: xtea-0.7.1-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 12.3 kB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a6b60898648e27a8c7b2f698672807c9ddd6f22f06915bc459f2de465f1aaa |
|
MD5 | 8405f0a955bf20a3b3393bc06b2ca607 |
|
BLAKE2b-256 | 0248875c211a9c878d3c8bca93ef937f2e3e060270dc99fbbe903ed969ff6109 |
File details
Details for the file xtea-0.7.1-cp35-cp35m-win32.whl
.
File metadata
- Download URL: xtea-0.7.1-cp35-cp35m-win32.whl
- Upload date:
- Size: 11.6 kB
- Tags: CPython 3.5m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.19.4 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59d00e875ccb441b153e9e9dbcf63421bfb87b8417816a8229936a8f21a4beeb |
|
MD5 | c4a9cd5d2c316f4240b82b4f8c998fc9 |
|
BLAKE2b-256 | 8f1ffc70cd46e54de7724603e9f874f85c60789e6248ce31695483ce6db4d2fb |