This is a simple implementation of the AES specification (the Rijndael algorithm)
in Java, served as a web applet.
Rijndael can be used to encrypt plaintexts of 128, 192, or 256 bits. Since this applet
only manipulates single blocks, this means that the longest strings it can handle are
32 bytes in length. In fact, the applet will require input strings to be exactly 16,
24, or 32 bytes long, except when manipulating text strings, in which case it will pad
the plaintext to the shortest appropriate length, using null bytes.
Hexadecimal strings are the obvious format for this type of application because they can
display any bit sequence (unlike text), and they are very compact in comparison to bit
strings. This applet works with hexadecimal I/O, but there is a converter built in to
allow the plaintext to be displayed as a text string. To activate the converter, simply
select the check box labelled ``Provide ASCII Conversion''. This will stomp on anything
in the Plain Text field during encryption, and on anything in the ASCII Text field during
decryption.
A common form of known-answer test for block ciphers is the Monte Carlo test. This
applet is capable of performing Monte Carlo computations. To enable this feature, select
the check box labelled ``Monte Carlo Mode''. However, be aware that this mode involves
10,000 encryptions or decryptions at once, and it may take a long time to complete on
some computer hardware. Using the Monte Carlo mode makes it easy to compare answers
against the known-answer tables provided by NIST (available on their web site).
To operate the applet, input a plaintext or ciphertext and a key. An example might be a
plaintext and key both equal to
``00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f''
(This is the first of the AES ``Intermediate Value Known Answer'' tests, and the correct
result is a ciphertext of
``0a 94 0b b5 41 6e f0 45 f1 c3 94 58 c6 53 ea 5a'').
Next, set the options if you want ASCII conversion or the Monte Carlo mode (see above).
Finally, select the Encrypt or Decrypt buttons. The new result should be placed in the
Cipher Text or Plain Text box, depending on whether you are encrypting or decrypting
(respectively). The Operations History text field will display a summary of the
calculations performed.
To clear all of the text fields and start over, press the Clear button. To clear only
the operation history, press the Clear History button. To exit the applet (to the
extent you can with a web applet) press the Exit button.