Module 04-Cryptography and Encryption
Module 04-Cryptography and Encryption
SECURITY
CRYPTOGRAPHY AND
ENCRYPTION
Cryptography
The word Cryptography comes from the Greek words,
“Crypt” means (hidden or secret) and “Graphy” means
(writing)
So, cryptography is the art of secret writing
The basic service provided by cryptography is the
ability to send information between participants in a
way that prevents others from reading it
Secure Channel for message transfer
between Alice and Bob
Sender Receiver
Encryption
Alternatively, Encryption is the actual process of
transforming information into an illegible format
Encryption basically is some process or algorithm to
make information hidden or secret
To make that process useful, you need some code to
make information accessible again
Modern day encryption uses different types of
algorithms to achieve results that vary in complexity
Encryption
A message in its original form is known as plaintext or
cleartext
The mangled information is known as ciphertext
Encryption is a process by which a message (called
plaintext) is transformed into another message (called
ciphertext) using a mathematical function and a special
encryption password (called a key)
The reverse of encryption is called decryption
Cryptography
Cryptographic systems tend to involve both an
algorithm and a secret value (means they use
encryption/decryption)
http://crypto-flash.tripod.com/transpositionFlash.htm
Cryptography
Q: How hard is it to break these simple ciphers?
Objective is to recover key not just message
Cryptanalytic attack
Ciphertext-only attack: use statistics and other
information to decrypt intercepted ciphertext
For example, simple statistics on letter placement and
occurrence in English makes further decryption simpler
Cryptography
Known-plaintext attack: if some of the plaintext is
known, one could uncover some of the plaintext-
ciphertext mappings, making decryption easier
For example, if we knew “Alice” was in the message, we get
some of the mappings right away without much difficulty
Examples:
ROT13: Very simple rotation algorithm
Caesar cipher: Another (better) rotation algorithm
Crypt: Original Unix encryption program
DES: Data Encryption Standard
AES: Advanced Encryption Standard
IDEA: International Data Encryption Algorithm
Skipjack: U.S. National Security Agency developed
algorithm
Symmetric Key Cryptography
K K
A-B A-B
Examples
Diffie-Hellman: the first public key approach
proposed
RSA: the best known public key system,
developed by Rivest, Shamir, and Adleman
DSA: Digital Signature Algorithm, developed by the
U.S. National Security Agency (NSA)
Asymmetric Key Cryptography
Keys are generated in pairs
Public key is publicly registered so everyone knows it,
and private one is kept secret by the owner
Each key can decrypt what the other encrypts, but not
what it encrypts itself (that why asymmetric)
+ Bob’s public
K
B key
- Bob’s private
K
B key
- Alice’s private
K
A key
+ Alice’s public
K
A key
K B− (K B+ (m)) = m = K A+ (K A − (m))
Modern Cipher
Asymmetric
Symmetric
Block
Stream
Ciphers and Their Types
Transposition: rearrange bits or characters in the data
(permutation)
Substitution: replace bits, characters, or blocks of
characters with substitutes
Monoalphabetic: A single alphabet is used to
encrypt the entire plaintext message
Polyalphabetic: A more complex substitution that
uses a different alphabet to encrypt each bit,
character, or character block of a plaintext message
A block cipher is one that breaks a message up into
chunks and combines a key with each chunk
A stream cipher is one that applies a key to each bit,
one at a time
Ciphers and Their Types
Caesar Cipher
One of the simplest examples of a cipher is the Caesar
cipher
It is a type of substitution cipher in which each letter in
the plaintext is replaced by a letter some fixed number
of positions down the alphabet
For example, with a shift of 3, ‘A’ would be replaced by
‘D’, ‘B’ would become ‘E’, and so on
Plaintext: the quick brown fox jumps over the lazy dog
Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH
ODCB GRJ
http://crypto-flash.tripod.com/caesarFlash.htm
Ciphers and Their Types
Vigenère Cipher
SEEME INMALL
INFOS EC I NFO
-----------------------------
ARJAWMPUNQZ
Classwork
Encrypt the plaintext
"a simple example"
using the keyword
“battista.“
Ciphers and Their Types
Vigenère Cipher Matrix
0 1 2 3 4 5 6 7 8 9
A B C D E F G H I J
10 11 12 13 14 15 16 17 18 19
K L M N O P Q R S T
20 21 22 23 24 25
U V W X Y Z
Ciphers and Their Types
Vigenère Cipher Example
Keyword = “monarchy”
m o n a r
c h y b d
e f g i/j k
l p q s t
u v w x z
Ciphers and Their Types
Playfair Cipher Matrix
If in same column
Move each letter down one
If in same row
Move each letter right one
If form a rectangle
Swap with the ends of the rectangle
Ciphers and Their Types
Playfair Cipher Example
AR becomes RM
CE becomes EL
HS becomes BP
EA becomes IM (or JM)
Balloon becomes ?
Ciphers and Their Types
Playfair Cipher Example
Example:
Plaintext: see me tomorrow
se em et om or ro wx
Ciphertext: li lc kl no nm mn xz
https://www.youtube.com/watch?v=quKhvu2tPy8
Ciphers and Their Types
Affine Cipher
Plaintext a f f i n e c i p h e r
x 0 5 5 8 13 4 2 8 15 7 4 17
5x+8 8 33 33 48 73 28 18 48 83 43 28 93
(5x+8) mod 8 7 7 22 21 2 18 22 5 17 2 15
26
Ciphertext I H H W V C S W F R C P
Ciphers and Their Types
Affine Cipher Example
Ciphertext I H H W V C S W F R C P
y 8 7 7 22 21 2 18 22 5 17 2 15
21(y-8) 0 (-1+ 525 294 273 (-6+ 210 29 (-3+ 189 420 147
26)* 26)* 4 26)*
21= 21= 21=
525 420 483
21(y-8) mod 26 0 5 5 8 13 4 2 8 15 7 4 17
Plaintext A F F I N E C I P H E R
Ciphers and Their Types
Affine Cipher Example
plaintext: SECRETMESSAGE
one-time pad: CIJTHUUHMLFRU
ciphertext: UMLKLNGLEDFXY
Module # 4
THANKS