# CSE 127: Lecture 3

This lecture covers encryption tools, with topics on Symmetric-Key Encryption for Communication, Stream Ciphers, Block Ciphers, Public-Key Encryption. Modular Math and Exponentiation,

Encryption schemes are composed of a set of algorithms:
K is the key generator, that is used for creating a key for a new communication, or for a new communicator.
E is the encryption algorithm, that uses the key and plaintext to create ciphertext.
D is the decryption algorithm, which, given the key and ciphertext, will recover the plaintext.

## Symmetric-Key Encryption for Communication

Communication between two parties Alice and Bob, that share a common secret key Sk, can be secured against eavesdroppers by means of a symmetric-key encryption scheme.

## Stream Ciphers

Stream ciphers use a simple construction: output a never-ending sequence of "key bits" and XOR these bits with the plaintext to obtain a ciphertext. Because the output "key bits" are determined exactly by the combination of the input key and the internal state, it is vital that the internal state and/or input key be varied for each new message.

Components of a stream cipher include:
Secret Key
Internal State
Next-state function
Output function

## Block Ciphers

We discussed two modes for using block ciphers, the Electronic Code Book (ECB) mode and the Cipher Block Chaining (CBC) mode.

Example Block Ciphers
Name of standard Key Length Block Length Search Begins Accepted as standard
DES (FIPS 46-3) 64 bits (54 random) 64 bits 1973 1976
AES (FIPS 81) 128, 192, or 256 bits 128 bits 1998(?) 2002

## Public-Key Encryption

RSA Security

RSA Encryption Scheme

 n = p * q, where p and q are primes phi(n) = |Zn*| phi(n) = (p-1)(q-1) d = e-1 mod ((p-1)(q-1)) c = me mod n m = cd mod n = med mod n

Popular choices for e include: 3, 17, and 65537. What do these numbers have in common? They're all (relatively) small, they're all primes, and they each have two "1" bits in their binary representation.

## Modular Math and Exponentiation

Square and Multiply Exponentiation

 e = sumi in Bits ei*2i xe = xsumi in Bits ei*2i = prodi in Bits (x2i)ei
Where ei is the ith bit of e.

[ search CSE | CSE | bsy's home page | links | webster | MRQE | google | yahoo | citeseer | pgp certserver | openpgp certserver ]

bsy+cse127.w03@cs.ucsd.edu, last updated Sat Jan 25 15:11:00 PST 2003. Copyright 2003 Bennet Yee.
email bsy.