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.1.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tea-python-1.1.tar.gz.
File metadata
- Download URL: tea-python-1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e1d3a35bed8029e590e2e06877dab51d76923b1ed45e790306861224cd3300f
|
|
| MD5 |
703e319a707b3fbc517b61ddf2a7c3c3
|
|
| BLAKE2b-256 |
d9c7da2328263a143f65ff3345f4a61a86be73f70b6343888ceb2a648b285532
|
File details
Details for the file tea_python-1.1-py3-none-any.whl.
File metadata
- Download URL: tea_python-1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14169c73bcf103a3d6fcccf6e1997ff72ff6e5dbed8e17b173b8b18267ec30a6
|
|
| MD5 |
e117c2cf892a6bea296e01c5baf2d9ee
|
|
| BLAKE2b-256 |
d399d361fad2cbcdfc33da2b482940a73c01389418f98d21f5282ae4770071d1
|