Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for Python. It is based on CFFI, so it is fast and support both cpython and pypy.

Project description

https://travis-ci.org/xxtea/xxtea-python.svg?branch=master https://img.shields.io/pypi/v/xxtea-py.svg https://img.shields.io/pypi/l/xxtea-py.svg https://img.shields.io/pypi/pyversions/xxtea-py.svg https://img.shields.io/pypi/implementation/xxtea-py.svg https://img.shields.io/pypi/status/xxtea-py.svg https://img.shields.io/pypi/dm/xxtea-py.svg https://img.shields.io/pypi/dw/xxtea-py.svg https://img.shields.io/pypi/dd/xxtea-py.svg

Introduction

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for Python.

It is based on CFFI, so it is fast and support both cpython and pypy.

It is different from the original XXTEA encryption algorithm. It encrypts and decrypts raw binary data instead of 32bit integer array, and the key is also the raw binary data.

Installation

pip install xxtea-py

Usage

Python2:

import xxtea
text = "Hello World! 你好,中国!"
key = "1234567890"
encrypt_data = xxtea.encrypt(text, key)
decrypt_data = xxtea.decrypt(encrypt_data, key)
print(text == decrypt_data);

Python3:

import xxtea
text = "Hello World! 你好,中国!"
key = "1234567890"
encrypt_data = xxtea.encrypt(text, key)
decrypt_data = xxtea.decrypt_utf8(encrypt_data, key)
print(text == decrypt_data);

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for xxtea-py, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size xxtea_py-1.0.3-py2-none-any.whl (6.8 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size xxtea_py-1.0.3-py3-none-any.whl (6.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size xxtea-py-1.0.3.tar.gz (205.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page