Unit 1
Unit 1
security
UNIT 1
CRYPTOGRAP
HY
By: Andrew Mwamba
2024
Contents
Introduction to Cryptography
Classic ciphers
Caesar Cipher
Vigenère Cipher
One-time Pad and Perfect Secrecy
Vernam cipher
Pseudo-random functions
Permutations
Computational security
Random bit generation
Secure hash functions
Birthday problem
Introduction
The Internet or the global Internet is the internationally
connected network of computer networks with addresses that are
administrated by IANA (Internet address and Naming Authority).
Ciphertext: wlmgurmwuzfogurmwzivnvwb
Plaintext: ????
1 2 3 4 5
1 A B C D E
2 F G H I/J K
3 L M N O P
4 Q R S T U
5 V W X Y Z
Vigenère Cipher
A shift cipher where every character is shifted differently
based on a code word (key)
In this example, the key is PIE. Then use the ciphertext
generated from the character before.
Row = Key, Column =Plaintext, Middle = Ciphertext
Plaintext: VI GENE RE
Key: PI E PI E P I
Ciphertext: K Q K T V I G M
Vigenère Cipher
Alberti Cipher Disk
Created by Italian Leon Battista Alberti
(1404)
Both parties agree on a priming key (inner
circle) – Lets use k
Every time you see a capital letter, you
switch to use that as the priming key
Ft&yxaepQmmepe&vmsGgimhvaahmyiAakz
Bit OR
00=0 01=1 10=1 11=1
That is,
message mM
ciphertext c C
Pr [M=m C=c] = Pr [M = m] Pr [C = c]
Definition 0 equiv. Definition 1
Definition 0 implies Definition 1
Idea: Given Pr [M=mC=c] = Pr [M = m] Pr [C = c],
for any c such that Pr [C = c] > 0, divide both
sides of the above with Pr [C = c], we have Pr
[M=m | C=c] = Pr [M = m].
Definition 1 implies Definition 0
Idea: cC s.t. Pr[C=c] > 0
Pr [M=m | C=c] = Pr [M = m], multiple both side by
Pr[C=c], obtain Pr [M=mC=c] = Pr [M = m]
Pr [C = c]
cC s.t. Pr[C=c] = 0 we have Pr
[M=mC=c] = 0 = Pr [M=m] Pr[C=c]
Perfect Secrecy. Definition 2.
Definition in Lemma 2.2. (Gen,Enc,Dec) over a
message space M is perfectly secure if
probability distribution over M
message mM (assuming Pr[M=m]>0)
ciphertext cC
We have
Pr [C=c | M=m] = Pr [C = c].
Challenger Adversary
k Gen() m0 , m 1 chooses m0, m1 M
b R {0,1} C=Ek[mb]
b’ {0,1}
Cipherttext space
Plaintext space
cipher text-key=plain-text
Some Rules for Encryption
First We chose plain text which we want to
convert into cipher text.
We can chose random key.
Key length is always equal to length of cipher
text.
After adding plain text and keys .If num is
≥26 then we subtract 26 from cipher text in
Encryption.
Keys have two copies One for sender and one
for receiver.
Keys is discarded after one time use.
Encryption Example
Decryption
Another Example “same
message” but now this time
key is different.
Encyption
H E L L O
7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message
= 30 16 13 21 25 message + key
E Q N V Z → ciphertext
Decryption:
E Q N V Z cipher-text
key = -19 4 11 11 14
H E L L O → message
Note
This cipher is unbreakable in a very strong
sense. The intuition is that any message can
be transformed into any cipher (of the same
length) by a pad, and all transformations are
equally likely
Modern use of the Vernam Cipher
Drawback in OTP
www.researchgate.net
www.swayam.com
www.wikipedia.com