In November the last year, I received an email which informed me that the encryption result of my Crypt_XXTEA package differs from some other implementations. And I made a reply to explain the reason.
XXTEA is a block cipher which requires the block size is at least two words, i.e. 32 bits. If the length of string is not multiples of 4, the last block must be fill up to 32 bits by some junk data. Thus the decrypted string will have the junk data at its end too. To solve this problem, the initial version of Crypt_XXTEA appends the length of string to the end of the converted long integer array, which can be used to cut the decrypted string to get the correct result.
Rencently, considered that this default behavior may confuse the user, I made some modifications. In the version of 0.9.0, users can handle the converting between string and long integer array with their own functions.
Link: http://pear.php.net/package/Crypt_XXTEA
XXTEA is a block cipher which requires the block size is at least two words, i.e. 32 bits. If the length of string is not multiples of 4, the last block must be fill up to 32 bits by some junk data. Thus the decrypted string will have the junk data at its end too. To solve this problem, the initial version of Crypt_XXTEA appends the length of string to the end of the converted long integer array, which can be used to cut the decrypted string to get the correct result.
Rencently, considered that this default behavior may confuse the user, I made some modifications. In the version of 0.9.0, users can handle the converting between string and long integer array with their own functions.
Link: http://pear.php.net/package/Crypt_XXTEA
Current language: English · also available in: Chinese (Simplified)