xxtea / xxtea
XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.
Installs: 35 208
Dependents: 1
Suggesters: 0
Security: 0
Stars: 112
Watchers: 7
Forks: 49
Open Issues: 5
Requires
- php: >=5.2.0
Requires (Dev)
- phpunit/phpunit: >=4.0.0
This package is not auto-updated.
Last update: 2024-04-24 21:17:22 UTC
README
Introduction
XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.
It is different from the original XXTEA encryption algorithm. It encrypts and decrypts string instead of uint32 array, and the key is also string.
Installation
Download the xxtea.php, and put it in your develepment directory.
Usage
<?php require_once("xxtea.php"); $str = "Hello World! 你好,中国!"; $key = "1234567890"; $encrypt_data = xxtea_encrypt($str, $key); $decrypt_data = xxtea_decrypt($encrypt_data, $key); if ($str == $decrypt_data) { echo "success!"; } else { echo "fail!"; } ?>