XTEA (TEA) Delphi implementation available for download
I have updated the XTEA algorithm implementation and made it available for download. The algorithm works on array of bytes or on streams. You also have support functions that help you encrypt / decrypt strings. The interface is shown bellow.
// XTEA encryption and decryption function function XTeaEncryptBytes(const Data, Key: TBytes): TBytes; function XTeaDecryptBytes(const Data, Key: TBytes): TBytes; procedure XTeaEncryptStream(const InStream, OutStream: TStream; const Key: TBytes); procedure XTeaDecryptStream(const InStream, OutStream: TStream; const Key: TBytes); // support functions for string <-> bytes conversions function GetBytesFromUnicodeString(const Value: TTeaUnicodeString): TBytes; function GetBytesFromAnsiString(const Value: TTeaAnsiString): TBytes; function GetUnicodeString(const Value: TBytes): TTeaUnicodeString; function GetAnsiString(const Value: TBytes): TTeaAnsiString;
The algorithm was also optimized so that the .NET compatibility is not a slowdown for Win32 native code anymore. You can download the code and demo app from the download page.
Please leave the comments here, or contact me directly, if you have troubles or questions.