Tiny Encryption Algorithm
Project description
tea
介绍
tea:TEA算法由剑桥大学计算机实验室的David Wheeler和Roger Needham于1994年发明。它是一种分组密码算法,其明文密文块为64比特,密钥长度为128比特。TEA算法利用不断增加的Delta(黄金分割率)值作为变化,使得每轮的加密是不同,该加密算法的迭代次数可以改变,本算法的迭代次数为32轮。
本软件包已上传到 pypi, 可通过 pip 进行安装:
pip install tea-python
示例代码:
import tea
if __name__ == '__main__':
key = "1122334455667788".encode()
origin = bytearray()
for i in range(16):
origin.append(i)
print('原数据: ', origin.hex())
encrypt_data = tea.encrypt(origin, key)
print('加密数据:', encrypt_data.hex())
decrypt_data = tea.decrypt(encrypt_data, key)
print('解密数据:', decrypt_data.hex())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tea-python-1.2.tar.gz
(3.1 kB
view details)
File details
Details for the file tea-python-1.2.tar.gz.
File metadata
- Download URL: tea-python-1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b36db41f1ebb16876b373dcfaa67df5d5a42629907e2eb669d960c8be6ad4b4
|
|
| MD5 |
e46dc0e8d10d781b6d4108801a58377b
|
|
| BLAKE2b-256 |
f1e681efea411f2f4c811ee9881d9dbe0a617ff85b5f104245c85fca0c222606
|