CCrypt version 1.01

CCrypt is a simple encryption program for the USR Pilot and PalmPilot
organizers.  


WARNING

It is a serious violation of US law to export this or any other
encryption program from the United States.  Don't do it.



USAGE

To encrypt, enter a pass phrase (up to 64 characters) in the field
marked "Key" and the plaintext in the large unmarked field.  The menu
option "Encrypt to Clipboard" will encrypt the plaintext using the key
and leave the ciphertext in the clipboard.  The ciphertext can then be
pasted into memos, address book entries, etc.

To decrypt, copy a ciphertext to the clipboard, start CCrypt, enter
the pass phrase in the key field, and execute the menu option "Decrypt
Clipboard".  The decrypted string will be displayed in the main field.

All data is cleared on exit from CCrypt or when the "Zero out key and
data" menu option is chosen.


ENCRYPTION METHOD

Data is encrypted using the Tiny Encryption Algorithm (TEA), a simple
but apparently strong algorithm developed by David Wheeler and Roger
Needham that encrypts 64 bit blocks using 128 bit keys.  Encryption
proceeds in several steps:

1. The 4-byte return value of TimGetSeconds() is prepended to the
plaintext.  This keeps the same plaintext from encrypting to the same
ciphertext twice.

2. The expanded plaintext is escaped to eliminate null characters by
representing 0x0 as 0x1 0x1 and 0x1 as 0x2.

3. The resulting text is padded with nulls to a multiple of 8 bytes.

4. This padded text is encrypted using TEA in cipher-block chaining
mode.

5. The ciphertext is again escaped to eliminate nulls and is copied to
the clipboard.


Decryption reverses these steps.


ERROR MESSAGES

Encryption can fail if escaping and padding results in a ciphertext
too big for the clipboard limit.

Decryption can fail if the ciphertext is corrupt or the key is wrong.
Failed decryptions are detected when they lead to nulls in the
plaintext (but are usually pretty obvious).


WEAKNESSES

The hash algorithm for converting the pass phrase to a key is not very
good.  Pass phrases of 16 characters or less are taken directly as a
key.  Longer pass phrases are converted to 16-byte keys in a rather
ham-fisted way.  Most encryption program instructions would at this
point lecture you on the importance of choosing a very long pass
phrase that contains a lot of randomness and is difficult to guess.  I
know that you have to Graffiti the pass phrase in every time you run
the program, and will probably pick something short.  That's ok, but
you will suffer a corresponding loss of security.

TEA has not been subjected to as cryptanalysis as extensively as more
venerable encryption systems like DES or IDEA.  It's not out of the
question that it may turn out to be breakable.


BUGS

There are many dependencies on the endianness of the Pilot CPU.  This
is not a problem unless you plan to decrypt data on a different
machine with different endianness (i.e., not a Pilot).



DISCLAIMERS

This program is provided "as is".  The author accepts no
responsibility for damage resulting from the use of this program and
disclaims all warrantees (including implied warranties of
merchantability or fitness) to the fullest extent allowed by law.  On
the whole, the author would be a lot happier if this program were not
used to do anything seriously illegal.


Jim Aspnes <aspnes@cs.yale.edu>
