Encryption by Permutation

Directions: Encrypt the following plain text. Sample key is displayed
in the box below. It should be a permutation of the sequence
ABCDEFGHIJKLMNOPQRSTUVWXYZ. Thus,
if the key is EUCLIDABFGHJKMNOPQRSTVWXYZ,
then a is mapped to A, b to U, etc.

Note: Even though this encryption scheme has a large number of keys, it can be broken by frequency analysis if a paragraph or so of ciphertext is available. The earliest known reference to frequency analysis is in "A Manuscript on Deciphering Cryptographic Messages," by al-Kindi. Al-Kindi's treatise was written in the ninth century but was subsequently lost, to be rediscovered in 1987 in an archive in Istanbul. See Simon Singh's "The Code Book."

Java source code
source code for the TextObject class

Cryptography