您的位置:首页 > 编程语言 > Python开发

XTEA加密的Python调用

2016-06-05 21:34 513 查看
https://pypi.python.org/pypi/xtea/0.4.0

xtea 0.4.0

Downloads ↓

A python version of XTEA
Latest Version: 0.4.1

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). Thisimplementation supports following modes of operation:ECB, CBC, CFB, OFB, CTR

It also supports CBC-MAC.

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python