Professional Documents
Culture Documents
A B C D E F G H I J K L MN O P Q R S T U V WX Y Z
D E F G H I J K L MN O P Q R S T U V WX Y Z A B C
How Is That Helpful?
• When using a Caesar cipher, you assign each letter to an
index starting from 0.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A B C D E
0 1 2 3 4
(cipher letter index – key + total number of letters) mod (total number of
letters)
Shift of 1 CABE
Shift of 2 BEAD The clear winner!
Shift of 3 ADEC
Shift of 4 ECDB
• If you were using the full English alphabet, this would take longer,
but for someone trying to find our your secret, it’s a small price to
pay!
Photo Encryption- Colors
• We can apply what we’ve learned about encryption to pictures too!
• As you may have noticed when using Photoshop, colors are
determined by concentrations of red, green, and blue. The amount
of each color is represented by a digit between 0 and 255.
• For instance, red would be represented as
(255,0,0)
+ =
+ =
Notice that adding two color values together is not the same as mixing
two colors (like you would when painting).
Adding Them Up- Mods
• What if we add two color values together and their sum is
greater than 255?
• (60,45,300) Not a color! The computer wouldn’t know what
to do with this information.
• This is where mods come in handy- like the Caesar Cipher, we
have 256 values. This means that after you add two values
together, you need to convert it to mod 256.
• (60,45,300)(60,45,44)
Decoding
• To decode this color, all the recipient needs to do is subtract
the color we added- in this case, we subtract the blue from
the light yellow.
- =
Applications
• We just encoded and decoded one pixel. We can apply this to
an entire picture by adding one image to another.
• Think of it this way- You have a photo that you are sending
and a photo that is your “key.” As long as the other person has
the key, they can subtract it from your encoded photo to get
back the original!
• This isn’t particularly useful in computer science, however,
because there is no way to stop someone from seeing your
photo key and decoding it themselves. They could intercept
this key (just like they could intercept the photo) if you try to
send it to anyone or make it public!
Cryptography
• Cryptography is the study and practice of hiding information.
Caesar’s cipher and photo encryption are just two ways to encrypt
and decrypt information. They are both too weak for real-world
applications.
• There are many methods of cryptography that are much more
foolproof than these two methods!
Symmetric Encryption
Attacking Symmetric Encryption
• cryptanalysis
• rely on nature of the algorithm
• plus some knowledge of plaintext characteristics
• even some sample plaintext-ciphertext pairs
• exploits characteristics of algorithm to deduce specific plaintext or key
• brute-force attack
• try all possible keys on some ciphertext until get an intelligible
translation into plaintext
Cryptanalysis
attacks:
ciphertext only - least info, hardest
known plaintext - some plain/cipher pairs
chosen plaintext - get own plain/cipher pairs
only weak algs fail a ciphertext-only attack
usually design algs to withstand a known-plaintext attack
Computationally Secure Algs
encryption is computationally secure if:
cost of breaking cipher exceeds info value
time required to break cipher exceeds the useful lifetime of the info
usually very difficult to estimate the amount of effort required to break
can estimate time/cost of a brute-force attack (see Ch 2)
Feistel
Cipher
Structure
Block Cipher Structure
have a general iterative block cipher structure
with a sequence of rounds
with substitutions / permutations controlled by key
parameters and design features:
block size
key size
number of rounds
subkey generation algorithm
round function
also: fast software en/decrypt, ease of analysis
Exhaustive Key Search
Symmetric Encryption Algorithms
Data Encryption Standard (DES)
Triple DES (3DES)
first used in financial applications
uses three keys & three DES executions:
S
S
Hash Function Requirements
1. applied to any size data
2. H produces a fixed-length output.
3. H(x) is relatively easy to compute for any given x
4. one-way property
• computationally infeasible to find x such that H(x) = h
5. weak collision resistance
• computationally infeasible to find y ≠ x such that H(y) = H(x)
6. strong collision resistance
• computationally infeasible to find any pair (x, y) such that H(x) = H(y)
Hash Functions
• two attack approaches
• cryptanalysis
• exploit logical weakness in alg
• brute-force attack
• trial many inputs
• strength proportional to size of hash code (2n/2)
• SHA most widely used hash algorithm
• SHA-1 gives 160-bit hash
• more recent SHA-256, SHA-384, SHA-512 provide improved size and
security
Public Key Encryption
Public Key Authentication
Authentication and/or data integrity
Public Key Requirements
1. computationally easy to create key pairs
2. computationally easy for sender knowing public key to
encrypt messages
3. computationally easy for receiver knowing private key to
decrypt ciphertext
4. computationally infeasible for opponent to determine private
key from public key
5. computationally infeasible for opponent to otherwise
recover original message
6. useful if either key can be used for each role
Public Key Algorithms
• RSA (Rivest, Shamir, Adleman)
• developed in 1977
• only widely accepted public-key encryption alg
• given tech advances need 1024+ bit keys
• Diffie-Hellman key exchange algorithm
• only allows exchange of a secret key
• Digital Signature Standard (DSS)
• provides only a digital signature function with SHA-1
• Elliptic curve cryptography (ECC)
• new, security like RSA, but with much smaller keys
Public Key
Certificates
See textbook figure p.63
Digital
Envelopes