Chapter 4 Using Crypto-C 129
System Considerations In Crypto-C
Key Size
In cryptography, security is measured in key size: the bigger the key, the greater the
security. Key size, in turn, is measured in bits. However, a bit number does not
necessarily describe the entire key.

DES Keys

A DES key is 56 bits. However, that size refers to its cryptographic size, not its
physical size. To build a DES key, you need 64 bits, but because eight of those bits are
parity bits, which are known, you really only get 56 secret bits. Therefore, a DES
key, while consisting of 64 bits of data, is only 56 cryptographic bits in length.

RSA Keys

An RSA key-pair measurement describes the modulus length. When cryptographers
talk about a 768-bit RSA key pair, what they really mean is that the modulus is 768
bits long. Because the security of an RSA key pair depends on how big the modulus is,
the measurement used is the bit-size of the modulus. However, the actual keys
themselves contain more information than the modulus, so the physical size is much
larger.

Public Key Size

A public key consists of a modulus and a public exponent. To store that public key
requires space for both of those components; so for a 768-bit public key, you need
more than 768 bits of storage space.
Many people who use the RSA algorithm use F4 as the public exponent. F4 is one of a
sequence of prime numbers with a special binary representation, which is 10.....01.
F4 is short for Fermat 4, first described by the 17th-century mathematician Pierre de
Fermat. Fermat believed that there are infinite prime numbers of the form
2^(2^n) + 1. Now it is believed that n = 4 is the last prime number in the sequence.
Because of their special representation, using these numbers speeds up the public key
operations of RSA encryption and RSA signature verification. F4 has been analyzed
by RSA Labs and others, and has been found to be secure.
F4 = 01 00 01 in hexadecimal notation (65,537 in decimal), and it is 17 bits long. If you
use F4, you need 785 bits of space to store a 768-bit public key and its public exponent.
Of course, storage space comes only in bytes, so you actually need 99 bytes of space.
In addition, when you access the public key, you need to know where the modulus