Registry / auth-security / xxtea
library5.1.0pypypiunverified

xxtea is a simple block cipher implementing the XXTEA encryption algorithm. Current version 4.0.0, requires Python >=3.9. Released under BSD license. Active development with periodic releases.

pip install xxtea
INSTALL
IMPORT
SIG · XXTEA
X
xxtea
auth-securitypythonv5.1.0
Install
1.8s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

encrypt
import xxtea; xxtea.encrypt(data, key, padding=True)
from xxtea import xxtea_encrypt
The legacy API used different function names. Use the module-level functions.
decrypt
import xxtea; xxtea.decrypt(ciphertext, key, padding=True)
from xxtea import decrypt
Direct import of decrypt works, but ensure you pass key as bytes, not string.

Encrypt and decrypt a bytes message using a key.

import os import xxtea data = b'Hello, World!' key = os.environ.get('XXTEA_KEY', 'secret').encode() encrypted = xxtea.encrypt(data, key) print(encrypted.hex()) decrypted = xxtea.decrypt(encrypted, key) print(decrypted)
Debug
Known issues
breakingThe encrypt() function returns bytes, not hex string as in some older versions or wrappers.
fix
Use xxtea.encrypt_hex() if you need hex output, or call .hex() on the result.
affects: >=3.0.0
gotchaThe key must be a bytes object; passing a string raises TypeError.
fix
Always encode your key: b'key' or 'key'.encode()
affects: all
gotchaPadding is enabled by default. Disable with padding=False only if you manually handle block size alignment.
fix
Leave padding=True unless you have a specific reason.
affects: >=1.2.0
deprecatedPython 2.7, 3.4, 3.5 support dropped in v3.0.0.
fix
Upgrade to Python >=3.6, preferably >=3.9.
affects: <3.0.0
Upgrade
Version history
5.1.0latest on PyPI · released Jun 15, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
28
Amazon
2
Resources
xxtea — pip install xxtea · libregistry