Docsity

Crypto Basics - Computer and Network Security - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Crypto Basics - Computer and Network Security - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Chapter 1  Introduction 1

Crypto Basics

Chapter 1  Introduction 2

The Cast of Characters

 Alice and Bob are the good guys

 Trudy is the bad guy

 Trudy is our generic “intruder”

Part 1  Cryptography 4

How to Speak Crypto

 A cipher or cryptosystem is used to encrypt

the plaintext

 The result of encryption is ciphertext

 We decrypt ciphertext to recover plaintext

 A key is used to configure a cryptosystem

 A symmetric key cryptosystem uses the same

key to encrypt as to decrypt

 A public key cryptosystem uses a public key

to encrypt and a private key to decrypt (sign)

Part 1  Cryptography 5

Crypto

 Basic assumption

o The system is completely known to the attacker
o Only the key is secret

 Also known as Kerckhoffs Principle

o Crypto algorithms are not secret

 Why do we make this assumption?

o Experience has shown that secret algorithms
are weak when exposed
o Secret algorithms never remain secret
o Better to find weaknesses beforehand

Part 1  Cryptography 7

Simple Substitution

 Plaintext: fourscoreandsevenyearsago

 Key:

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 D E F G H I J K L M N O P Q R S T U V W X Y Z A B

z C

 Ciphertext:

IRXUVFRUHDAGVHYHABHDUVDIR

 Shift by 3 is “Caesar’s cipher”

Plaintext

Ciphertext

Part 1  Cryptography 8

Ceasar’s Cipher Decryption

 Plaintext: spongebobsquarepants

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 D E F G H I J K L M N O P Q R S T U V W X Y Z A B

z C

Plaintext

Ciphertext

 Suppose we know a Ceasar’s

cipher is being used

 Ciphertext:

VSRQJHEREVTXDUHSDQWU

Part 1  Cryptography 10

Cryptanalysis I: Try Them All

 A simple substitution (shift by n) is used

 But the key is unknown

 Given ciphertext: CSYEVIXIVQMREXIH

 How to find the key?

 Only 26 possible keys  try them all!

 Exhaustive key search

 Solution: key = 4

Part 1  Cryptography 11

Even-less-Simple Substitution

 Key is some permutation of letters

 Need not be a shift

 For example

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 J I C A X S E Y V D K W B Q T Z R H F M P N U L G

z O

Plaintext

Ciphertext

 Then 26! > 2^88 possible keys!

Part 1  Cryptography 13

Cryptanalysis II

 Can’t try all 2^88 simple substitution keys

 Can we be more clever?

 English letter frequency counts…

0.

0.

0.

0.

0.

0.

0.

0.

A C E G I K M O Q S U W Y

Part 1  Cryptography 14

Cryptanalysis II

 Ciphertext:

PBFPVYFBQXZTYFPBFEQJHDXXQVAPTPQJKTOYQWIPBVWLXTOXBTFXQWA XBVCXQWAXFQJVWLEQNTOZQGGQLFXQWAKVWLXQWAEBIPBFXFQVX GTVJVWLBTPQWAEBFPBFHCVLXBQUFEVWLXGDPEQVPQGVPPBFTIXPFHXZ HVFAGFOTHFEFBQUFTDHZBQPOTHXTYFTODXQHFTDPTOGHFQPBQWAQ JJTODXQHFOQPWTBDHHIXQVAPBFZQHCFWPFHPBFIPBQWKFABVYYDZB OTHPBQPQJTQOTOGHFQAPBFEQJHDXXQVAVXEBQPEFZBVFOJIWFFACF CCFHQWAUVWFLQHGFXVAFXQHFUFHILTTAVWAFFAWTEVOITDHFHFQ AITIXPFHXAFQHEFZQWGFLVWPTOFFA

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

21 26 6 10 12 51 10 25 10 9 3 10 0 1 15 28 42 0 0 27 4 24 22 28 6

Z

8

Ciphertext frequency counts:

 Decrypt this message using info below

Part 1  Cryptography 16

Double Transposition

 Plaintext: attackxatxdawn

Permute rows and columns

 Ciphertext: xtawxnattxadakc

 Key: matrix size and permutations

(3,5,1,4,2) and (1,3,2)

Part 1  Cryptography 17

One-time Pad Encryption

e=000 h=001 i=010 k=011 l=100 r=101 s=110 t=

h e i l h i t l e r

s r l h s s t h s r

Encryption: Plaintext  Key = Ciphertext
Plaintext:
Key:
Ciphertext:

Part 1  Cryptography 19

One-time Pad Summary

 Provably secure, when used correctly

o Ciphertext provides no info about plaintext
o All plaintexts are equally likely
o Pad must be random, used only once
o Pad is known only by sender and receiver
o Pad is same size as message

 Why not distribute message the same way

as the pad?

Part 1  Cryptography 20

Real-world One-time Pad

 Project VENONA

o Soviet spy messages from U.S. in 1940’s
o Nuclear espionage, etc.
o Thousands of messages

 Spy carried one-time pad into U.S.

 Spy used pad to encrypt secret messages

 Repeats within the “one-time” pads made

cryptanalysis possible