CodeBase - DBPro Implementation of XXTEA (Tiny Encryption Algorithm)

Return to the CodeBase listing

Category: Miscellaneous

Version: 1.0



Uploaded: 19th Oct 2011 08:32

Modified: 1st Jan 1970 01:00

Author:  The Sab


XXTEA is a low profile encryption algorithm created by Roger Needham and David Wheeler. It was expanded upon by Chris Veness in a java script to encrypt strings instead of just binary data. This is the version that I based the following code on.

Full Description

To encrypt a file call the 'encrypt(<message$>, <password$>)' function. It returns an encrypted string of the original message.<br /> <br /> To decrypt a file call the 'decrypt(<ciphertext$>, <password$>)' function. It returns the decrypted string.<br /> <br /> The encrypted string is composed only of alpha-numeric characters (as well as '+', '=', and '/') so it can be transmitted and printed without worry from control characters. Any control characters in the original message will be stored, encrypted and decrypted and will be present in the decrypted string, though of course, if that string is written to file or print to screen, DBPro will strip them out all control characters at that time.<br /> <br /> There is currently a small bug, however. I have found a couple of strings that do not work, and I am not sure why. For example, the string:<br /> "1234567890123456789012345678901234567890123456789012345678901234567890123456789012"<br /> will not make it through the algorithm correctly, however if you add or remove a character to that string, it works fine.<br /> <br /> Also note that there are a few places in the code that could be refined or even removed. These arose during the transcription process from the java original code. DBPro does some things differently, and I decided to keep the code as close to the original as I could at this time.


No comments yet.