Cryptography Primer

by Ian Kuon

Overview

There are numerous cases where one would want to securely transmit data in particular when a communication link is used. In this application note I'll explain a few of the encryption strategies available and discuss their appropriateness for hardware applications. The intent is to familiarize people with the algorithms available so as to make selecting one easier than it was for us.

There are two basic categories of encryption schemes

Stream Ciphers have been covered in another application note found here so I'll cover block ciphers in greater detail.

Block Ciphers

While stream ciphers are the logical candidate for digital designs, block ciphers are described as the "workhorse of modern" cryptography because of their flexibility. They can be used in various modes to act as one way hash functions, PRNG, authenticators for messages and, for us, most significantly self synchronizing stream ciphers.

There are hundreds of block ciphers out there and they all have their uses. I'll describe some of the algorithms we investigated

Data Encryption Standard (DES) - This is one of the older algorithms out there having been developed in the 70's by the NSA and IBM. It has a 56 bit key and it operates on 64 bit words. It has been studied in great detail and has lost much of its security since it can be cracked in a few hours maybe even shorter for the NSA. It was designed to be built in hardware.

Blowfish - This is a very flexible algorithm developed by Bruce Schneier, the author of one of the most influential books in this area, Applied Cryptography. This has been the subject of another app note found here.

IDEA- Was briefly considered as the proposed encryption standard. It uses 64 bit blocks with a 128 bit long key. There's multiplication required for the algorithm so for hardware implmentations this may be rather large. For what it's worth this is Bruce Schneier's favorite.

3-Way - This is another block cipher with a 96 bit key that operates on 96 bit blocks. It was developed by Joan Daemen, the author of the recently proposed AES.(see below) Schneier also considers this to be a strong algorithm. We selected this algorithm to use in our project. It is very efficient in hardware and its 96 bit blocks work well with the 192 bit frames used in DS1 framing(There will be another app note on this shortly). I'll post our VHDL code here once it's finished.

I have the source code for all these algorithms and I will put it up once I ascertain that it is legal to do so.

 

Recently there has been a competition/search to find the successor to DES, the Advanced Encryption Standard (AES). Five Finalists were selected and the winner was selected earlier this month. The criteria for the AES was that it had to be a symmetric key block cipher with a 128 bit key. The algorithm selected was Rijndael. While the algorithms are all fairly different in their approaches, it is beyond the scope of this course and this author to seriously discuss the differences. If you're interested more information can be found at http://csrc.nist.gov/encryption/aes/round2/r2algs.htm. For the curious the other finalists were

MARS
RC6
SERPENT
TWOFISH

 

Self Synchronization

With any communications link there are always issues such as bit errors, latency, etc that effect the condition of the bits received. Depending on the type of link one can't be sure of when the data started; thus, there is clearly a need for a self synchronizing stream ciphers. This is where block ciphers show their strength. When they are used in Cipher Feedback Mode(CFB), a block cipher becomes self-synchronizing. The following block diagram summarizes the process of using CFB encryption

Encryption

Decryption

To summarize the process, encryption/decryption is performed using the block cipher on an already encrypted/received group of bits. The output bits are then used to encode the next block. Thus, to synchronize, one only has to receive the number of bits required for a block and then decryption can be performed. To ensure reliable reception and no data loss an Initialization Vector(IV) is required. This vector forms the first group of bits that will be used for encryption or decryption. The final xor with the output from the block encryption can be performed using any number of bits. Even 1 bit could be used in which case the algorithm would be completely self synchronizing(i.e you don't even have to know the boundary between bytes); however, this approach might be overkill since it requires one to use a block cipher of 64 or more bits simply to encrypt one bit.

 

References

Schneier, Bruce. Applied Cryptography 2nd Edition. John Wiley. United States. 1996.

NIST, Advanced Encryption Standard (AES) Development Effort, http://csrc.nist.gov/encryption/aes/

 

If you have any questions or concerns please e-mail me.

 

Written by Ian Kuon and Mark Calder from the SecureT group, October 18, 2000.