Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP JavaScript

Merge pull request #1 from pear/topics/composer-for-pear

Updated/New Composer support for Crypt_Xtea
latest commit f9c2cfd486
@till till authored
Failed to load latest commit information.
.gitignore Enhancement: composer setup
Makefile RC5
Xtea.php RC4
XteaTest.php RC2
composer.json Enhancement: composer setup
full.php RC2
package.xml RC5
tester.php RC2
xtea.js RC5
xteacmd.php RC5


Crypt_Xtea documentation

The Crypt_Xtea package is a simple class to enable XTEA encryption on
sites where e.g. the mcrypt module is not installed.
The original C code on which this class is based was found at
Currently to be found at:

Use of the class is fairly straightforward:

	require_once 'Crypt/Xtea.php';

	$data = 'abcdefghijklmnopqrstuvwxyz';
	$key = '0123456789abcdef';

	$crypt = new Crypt_Xtea();
	$encrypted = $crypt->encrypt($data, $key);
	$decrypted = $crypt->encrypt($encrypt, $key);

The output of both the encrypt() and decrypt() functions is a binary

For your convenience a PHPUnit test class and test script have been
installed in the PEAR tests directory. To use it, check the Makefile
or try:

	make profile test

In version 1.1 a major bug in doing signed/unsigned calculations was
fixed after reports on the class not working on a Mac (thanks to
David Costa). Due to the fix the encryption/decryption process is now
relatively slow. Please check whether the amounts of data you want to
encrypt are relatively small, otherwise I'd suggest using the mcrypt
Something went wrong with that request. Please try again.