You are on page 1of 22

Lesson 5-Cryptography

Objectives
• Upon completion of this lesson, the learner
will be able to:
– Identify the three types of cryptography.
– Describe the three types of cryptography.
– List current cryptographic algorithms.
– Describe current cryptographic algorithms.
– Explain how cryptography is applied for security.
What it Looks Like
Terminology
• Plaintext
–The original message we want to keep secret
•Encryption algorithm
–Takes the plaintext (and key) and produces modified
(preferably unintelligible) output, i.e. the ciphertext
•Secret key
–Used as input to encryption algorithm to change the output
produced by the algorithm
•Ciphertext
–The encrypted message
•Decryption algorithm
–Takes the ciphertext and key to produce the original
plaintext message
Keys

Keys
• To create ciphertext and turn it back to
plaintext we apply a key to the cipher.
• The security of the ciphertext rests with the
key. This is a critical point. If someone gets
your key, your data is compromised.
• This type of key is called a private key.
• This type of cipher system is efficient for
large amounts of data.
• This is a symmetric cipher.
Encryption Schemes
• All the current encryption schemes are based
upon an algorithm, a recursive computational
procedure for solving a problem in finite steps.
• An algorithm is a step-by-step problem-solving
procedure.
• It is a recursive computational procedure for
solving a problem in finite steps.
• A cryptographic algorithm is a set of
mathematical steps for encrypting and
decrypting information.
Requirements for Security
• For a symmetric encryption system to be secure, it
must:
1.Have a strong encryption algorithm. Given the
algorithm and ciphertext, an attacker cannot obtain
the key or plaintext.
2.Sender and receiver have knowledge of the secret
key (and keep it secret).
•Do not have to keep algorithm secret –only the key
–Allows for mass and cheap manufacturing of devices
that perform symmetric key encryption
Caesar Cipher
• A Caesar cipher uses an algorithm and a key.
– The algorithm specifies that you offset the letters
of the alphabet either to the right (forward) or to
the left (backward).
– The key specifies how many letters the offset is.
Caesar Cipher

• Replace each letter with the one “three over”


in the alphabet.

10
Public domain image from http://commons.wikimedia.org/wiki/File:Caesar3.svg
Substitution Cipher
• The weakness of shift ciphers led to substitution
ciphers.
– Substitution ciphers work on the principle of substituting a
different letter for every letter.
– This system permits 26 possible values for every letter in a
message.
– The cipher is more complex than a standard shift cipher.
– Simple analysis of the cipher retrieves the key.
– One looks for common letters and patterns that would
become words.
– One may determine which cipher letter corresponds to
which plaintext letter. This determines this system's key
value.
Substitution Cipher
• The shift pattern above could be replaced by
random assignment of characters for each
alphabet
• E.g., ABCDEFGHIJKLMNOPQRSTUVWXYZ
PMJSQOLEYTVUAXIKCGBWDRNHZF
• This would also give 26! possibilities

12
Vigenère Cipher Table
ABCDEFGHIJKLMNOPQRSTUVWXYZ

A ABCDEFGHIJKLMNOPQRSTUVWXYZ
B BABCDEFGHIJKLMNOPQRSTUVWXY
C CDEFGHIJKLMNOPQRSTUVWXYZAB
D DEFGHIJKLMNOPQRSTUVWXYZABC
E EFGHIJKLMNOPQRSTUVWXYZABCD
F FGHIJKLMNOPQRSTUVWXYZABCDE
G GHIJKLMNOPQRSTUVWXYZABCDEF
H HIJKLMNOPQRSTUVWXYZABCDEFG
I IJKLMNOPQRSTUVWXYZABCDEFGH
J JKLMNOPQRSTUVWXYZABCDEFGHI
K KLMNOPQRSTUVWXYZABCDEFGHIJ
L LMNOPQRSTUVWXYZABCDEFGHIJK
MMNOPQRSTUVWXYZABCDEFGHIJKL
13
Vigenère Cipher Table (cont’d)
ABCDEFGHIJKLMNOPQRSTUVWXYZ

N NOPQRSTUVWXYZABCDEFGHIJKLM
O OPQRSTUVWXYZABCDEFGHIJKLMN
P PQRSTUVWXYZABCDEFGHIJKLMNO
Q QRSTUVWXYZABCDEFGHIJKLMNOP
R RSTUVWXYZABCDEFGHIJKLMNOPQ
S STUVWXYZABCDEFGHIJKLMNOPQR
T TUVWXYZABCDEFGHIJKLMNOPQRS
U UVWXYZABCDEFGHIJKLMNOPQRST
V VWXYZABCDEFGHIJKLMNOPQRSTU
W WXYZABCDEFGHIJKLMNOPQRSTUV
X XYZABCDEFGHIJKLMNOPQRSTUVW
Y YZABCDEFGHIJKLMNOPQRSTUVWX
Z ZABCDEFGHIJKLMNOPQRSTUVWXY

14
Polyalphabetic Cipher
• E.g., Message = SEE ME IN MALL
• Take keyword as INFOSEC
• Vigenère cipher works as follows:
SEEME I NMALL
I NFOSEC I NFO
-------------------------------------
A RJ AWMPUNQZ

15
Polyalphabetic Cipher
• To decrypt, the receiver places the keyword
characters below each ciphertext character
• Using the table, choose the row
corresponding to the keyword character and
look for the ciphertext character in that row
• Plaintext character is then at the top of that
column

16
Hashing
• A hash is a special mathematical function that
performs one-way encryption.
• Once the algorithm is processed, there is no
way to:
– Take the ciphertext and retrieve the plaintext that
was used to generate it.
– Generate two different plaintexts that compute to
the same hash value.
Hashing
One-Way Encryption

hashing Fixed length hash


clear function or message digest
text

Munging the document gives a short


message digest (checksum). Not possible to go
back from the digest to the original document.
Hashing
one-way encryption: another example

Note the significant change in the hash sum for minor changes in the
input. Note that the hash sum is the same length for varying input sizes.
This is extremely useful.
*Image courtesy Wikipedia.org.
Hashing
• Common uses of hashing functions are storing
computer passwords and ensuring message
integrity.
– Two of the popular hash algorithms are:
– Secure Hash Algorithm (SHA)
– Message Digest of varying versions (MD2, MD4,
MD5)
Example: A, FOOL, AND, HIS, MONEY, ARE,
SOON, PARTED
h(K) = sum of K ‘s letters’ positions in the
alphabet MOD 13
Example: the word FOOL stored in the 9th cell
((since 6+15+15+12) mod 13 = 9)
End of Chapter 5

You might also like