Sidebar to the article The code makers, by Raymond E. Dessy, Trends in Analytical Chemistry,16 (1997) 1 © 1996 Elsevier Science bv.
THE MATH: Typical RSA approaches have you choose two prime numbers, p and q, and calculate their product, n=pq. Next, choose a number, e, that is less than n and shares no common divisor with [(p-1)(q-1)]. Then calculate the inverse, d, of e; defined by ed=1,(mod[(p-1)(q-1)]). This means that when ed is divided by the number in [] brackets it gives a remainder of 1. Spreadsheets, BASIC and C all have "mod(ulus)" functions. They are nothing more than integer division functions that give the quotient and/or remainder. The numbers d and e form the foundation of the asymmetric keys.
When A sends a message, m, the encrypted Private Key form, c, is c=m^d(mod n). When B decrypts c with the matching Public Key the calculation is m=c^e(mod n), which expands to the identity m=m^ed,(mod n). For the first two prime numbers, p=3 and q=5, n=15. For e=11, d=3. If m=2, then c=8. That's all there is!
There are other possible key pairs in this simplified example; e.g., 13 & 5. Real-life keys are much bigger to prevent breaking the code. How big are the keys? Currently, certification authorities might use a modulus of 1024-2048 bits, split about equally between the two primes. The number of primes expressible with 512 bits or less is estimated to be greater than the number of atoms in the universe. A 512-1024 bit modulus might be more appropriate for a user. Can they be cracked? RSA-129, a "challenge to attack task" with a public key of 129 decimal digits (430 bits), was recently cracked after 8 months realtime, and 5,000 MIPS-years of computing. Using current computer power and cost growth factors, assuring security to the year 2020 will probably require "super-master" keys of 600 decimal digits, and regular keys of 200 decimal digits. Such attacks will require a $25M investment in 1995 dollars as Moore's Law and increasing key sizes neutralize one another.
SEK keys often use the primitive operations of shuffling, substitition, permuting and XORing to achieve their goals. The NIST Digital Encryption Standard, DES, currently works on 64 bit blocks of plain-text with a 56 bit key. Used in this way it is called Electronic Codebook (ECB). It can be strengthened from attack by Cipher Block Chaining (CBC) where each 64 bit plaintext block is XORed with the previous cipher-text block before encryption. This is the most widely used mode.
Other approaches operate on a bit-by-bit basis in a streaming fashion, using XOR of the encrypted data stream with the key stream and logic feedback. SEK keys can be much shorter than PPK keys, since PPKs are subject to attacks by factoring and other techniques. SEK keys usually require a brute-force attack. Estimates suggest the need for 75-90 bits to meet attacks in 2020. DESX eXtends the DES key length by pre-/post-processing to ~128 bits. Three-key triple repeating T-DES (192 bits) currently has no known attacks. The ANSI-accredited X9F1 working group is currently setting standards on extensions. DES must be rereviewed in 1997.