Lecture 2
Lecture 2
09/06/16
Fall 2016
Introduction to Cryptography
Outline
• What is data encryption?
• Cryptanalysis
• Basic encryption methods
▫ Substitution ciphers
▫ Permutation ciphers
Introduction to Encryption
• Much of computer security is about keeping
secrets
• One method is to make the secret hard for others
to read
• While (usually) making it simple for authorized
parties to read
Encryption
• Encryption is the process of hiding information
in plain sight
• Transform the secret data into something else
• Even if the attacker can see the transformed
data, he can’t understand the underlying secret
Encryption and Data Transformations
• Encryption is all about transforming the data
• One bit or byte pattern is transformed to another
bit or byte pattern
• Usually in a reversible way
Encryption Terminology
• Encryption is typically described in terms
of sending a message
▫ Though it’s used for many other
purposes
• The sender is S
• The receiver is R
• And the attacker is O
More Terminology
• Encryption is the process of making
message unreadable/unalterable by O
• Decryption is the process of making the
encrypted message readable by R
• A system performing these
transformations is a cryptosystem
▫ Rules for transformation sometimes
called a cipher
Plaintext and Ciphertext
• Plaintext is the original Transfer $100 to my
savings account
form of the message
(often referred to as P)
0 1 0 0 0 1
Could the message decrypt
to either or both of these?
0 0 0 0 1 1
Security of One-Time Pads
• If the key is truly random, provable that it
can’t be broken without the key
• But there are problems
• Need one bit of key per bit of message
• Key distribution is painful
• Synchronization of keys is vital
• A good random number generator is hard
to find
One-Time Pads and Cryptographic
Snake Oil
• Companies regularly claim they have
“unbreakable” cryptography
• Usually based on one-time pads
• But typically misused
▫ Pads distributed with some other crypto
mechanism
▫ Pads generated with non-random
process
▫ Pads reused
Permutation Ciphers
• Instead of substituting different characters,
scramble up the existing characters
• Use algorithm based on the key to control how
they’re scrambled
• Decryption uses key to unscramble
Characteristics of Permutation Ciphers
• Doesn’t change the characters in the message
▫ Just where they occur
• Thus, character frequency analysis doesn’t help
cryptanalyst
Columnar Transpositions
• Write the message characters in a series of
columns
• Copy from top to bottom of first column, then
second, etc.
Example of Columnar Substitution
How did this transformation happen?
T r a n s f T e 0 y n c
e r $ 1 0 r r g o
0 t o m a t s s u
y s a v i n $ o a n
n g s a c s 1 v a t
c o u n t f 0 m i c
$ 1 0 0