4slv / xxtea
XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.
v1.0.7
2022-01-13 18:03 UTC
Requires
- php: >=5.2.0
Requires (Dev)
- phpunit/phpunit: >=4.0.0
This package is not auto-updated.
Last update: 2024-11-16 04:52:56 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.
Usage
<?php use xxtea\Xxtea; $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!"; } ?>