Skip to main content

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.

Source Distribution

xxtea-py-1.0.3.tar.gz (205.8 kB view details)

Uploaded Source

Built Distributions

xxtea_py-1.0.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

xxtea_py-1.0.3-py2-none-any.whl (6.8 kB view details)

Uploaded Python 2

File details

Details for the file xxtea-py-1.0.3.tar.gz.

File metadata

  • Download URL: xxtea-py-1.0.3.tar.gz
  • Upload date:
  • Size: 205.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.2.1 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.7

File hashes

Hashes for xxtea-py-1.0.3.tar.gz
Algorithm Hash digest
SHA256 32ee8e2c3a6c1fb86d3b4e06745ee041c2e7fcd6bcd7bd57d9d1134108307ce6
MD5 2712f9d4d182f22f0998244a652a7c7a
BLAKE2b-256 d8bd76a41a104223dbb9fb9600680f0f7affb6dacda1a29377c560ee30118630

See more details on using hashes here.

File details

Details for the file xxtea_py-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: xxtea_py-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.2.1 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.7

File hashes

Hashes for xxtea_py-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86e3194fe5bdc68ea6d30cf1d7d08c832250dfa33a366624e202a1f6376e1486
MD5 98b5ca2af07a40080e5333e5b1b2a422
BLAKE2b-256 9433474350314d2a64f8b6edb982201f6a82319ec6e60eb0e3ddf537e294fb14

See more details on using hashes here.

File details

Details for the file xxtea_py-1.0.3-py2-none-any.whl.

File metadata

  • Download URL: xxtea_py-1.0.3-py2-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.2.1 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.7

File hashes

Hashes for xxtea_py-1.0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 8df8ee0d76a4bb3a033ff666173f42ed1f01dd21d1b12423118e0e9a30e2e4e8
MD5 ab7e3a2575cdecadcc8f1d8584dc57cf
BLAKE2b-256 e426c7b3f53f61e779f94aad8e836cbc0f60e723b177ab229a79ffe61451b04a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page