Name: Luis Miguel Cortés Peña GTID: 901 67 6476 GTG: gtg683t SeChat: An AES Encrypted Chat Abstract With the advancement in computer technology, it is now possible to break DES 56 bit key in a meaningful time period. In order to secure information with today s technology, encryption algorithms with longer keys are needed. The National Institute of Standards and Technology (NIST) accepted the encryption/decryption algorithm known as Rijndael as the Advanced Encryption Standard. This standard allows for encryption of 128 bit blocks using 128, 192, or 256 bit keys. Advantages of AES include low memory requirement and fast in both software and hardware. In this paper, the operation of AES is explained and an implementation of an AES encrypted chat (called SeChat) written in Java is given. Introduction AES operates on a 4x4 array of bytes (referred to as state ). The algorithm consists of performing four different simple operations. These operations are: SubBytes ShiftRows MixColumns AddRoundKey SubBytes perform byte substitution which is derived from a multiplicative inverse of a finite field. ShiftRows shifts elements from a given row by an offset equal to the row number. The MixColumns step transforms each column using an invertible linear transformation. Finally, the AddRoundKey step takes a 4x4 block from a expanded key (derived from the key), and XORs it with the state. AES is composed of four high level steps. These are: 1. Key Expansion 2. Initial Round 3. Rounds 4. Final Round The Key Expansion step is performed using Rijndael s key schedule (see http://en.wikipedia.org/wiki/rijndael_key_schedule ). The Initial Round consists only of an
AddRoundKey operation. The Rounds step consists of a SubBytes, ShiftRows, MixColumns, and an AddRoundKey operation. The number of rounds in the Rounds step varies from 10 to 14 depending on the key size. Finally, the Final Round performs a SubBytes, ShiftRows, and an AddRoundKey operations. Decryption in AES is done by performing the inverse operations of the simple operations in reverse order. However, as shown later on in this paper, because of the block cipher mode of operation used, decryption was implemented but never used. More information on AES can be found on: http://csrc.nist.gov/publications/fips/fips197/fips 197.pdf and http://en.wikipedia.org/wiki/advanced_encryption_standard Implementation The AES algorithm is implemented from scratch using Java. First, the algorithm is tested by encrypting and decrypting a single 128 bit block. After having an operational block cipher, the next step is to embed this block cipher in a block cipher modes of operation. Cipher feedback (CFB) shown in Figure 1 and Figure 2, is chosen since the message does not have to be padded to a multiple of the cipher block size while preventing some manipulation of the cipher text. Figure 1: Encryption using Cipher Feedback (CFB).
Figure 2: Decryption using Cipher Feedback (CFB). As can be observed from Figure 1 and Figure 2, CFB only requires encrypting for both encrypting and decrypting modes of operation. The Initialization Vector (IV) was generated from a SHA 256 message digest of a string concatenated with a time stamp. Only the first 128 bits were used for the Initialization Vector. The Initiation Vector is transmitted without encryption, and only on the first transmission. Subsequent transmissions use the previously transmitted block as an input to the block cipher encryption. SeChat provides two capabilities. The first, and most obvious, is the capability to chat using SeChat. Figure 3 shows SeChat in an ongoing conversation.
Figure 3: Graphical User Interface of SeChat. The input to the Key shown in Figure 3 can be any string. This string is then used to generate SHA 256 message digest, which gets truncated depending on the number of bits selected for the key length. SeChat supports 128, 192, and 256 as the standard specifies. The second capability of SeChat is the capability to encrypt a message and output the message in Hex which can be copied and sent over email. Figure 4 below shows SeChat being used for encrypting and decrypting a Hex message.
Figure 4: SeChat encrypting to Hex (left, Host OS) and decrypting from Hex (right, Guest OS). In the case that the key is mismatched, the output becomes unreadable. An example of this is shown in Figure 5 where the Host OS user uses key a shared secret while the Guest OS user uses key another shared secret.
Figure 5: SeChat encrypting to Hex (left, Host OS) and decrypting from Hex (right, Guest OS) with mismatched secret keys. Included in the SeChat.rar are the following files: AES.java Source code for the AES encrypting/decrypting algorithm, run this file for encrypting/decrypting demo. SeChatPanel.java Source code for the Java Application version of SeChat (as shown in Figure 3, Figure 4, and Figure 5) SeChat.java Source code for the Java Applet version of SeChat. SeChat.jar The executable packed version of the whole package, it executes SeChatPanel. Run this file to execute SeChat.
Conclusion In this paper, a quick overview of AES was presented. More importantly, SeChat, an AES encrypted chat written in Java was introduced. The two capabilities of SeChat, namely chat and encrypt/decrypt to/from Hex, were presented. The case of having different keys in the chat, which results in illegible text, was also shown. A disadvantage of using SeChat is that the shared key has to be agreed on in advance. However, this can be overcome by using public key encryption on top of AES for to agree on a key to use. Implementation of public key encryption in conjunction to the AES encryption is left as future work.