Ch3. Cryptography - Cipher 1 1
Ch3. Cryptography - Cipher 1 1
Jumana Khwaileh-LTUC
Learning Objectives
Plaintext m e e t m e a f t e r t h e t o g a p a r t y
Chipertext P H H w P H D I W H U W K H W R J D S D U W B
Alphabet A B C D E F G H J K L M N O P Q R S T U V W X Y Z
Shift # 7
H J K L M N O P Q R S T U V W X Y Z A B C D E F G
Plaintext m e e t m e a f t e r t h e t o g a p a r t y
Chipertext T M M A T M H N A M Y A P M A V O H W H Y A F
Caesar Cipher Algorithm
• Can define transformation as:
abcdefghijklmnopqrstuvwxyz
DE F GHI JKLMNOPQRSTUVWXYZABC
• Mathematically give each letter a number
abcdefghij 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
C=(P+K) mod26 L 11
L 11
H- C=(7+3)mod26 c=10mod26=10
O 14
get the letter from the table that has the value of 10
So H becomes K
E- C=(4+3)mod26 =7
get the letter from the table that has the value of 7 Letter “E” become “h”
Caesar Cipher Algorithm
• Mathematically give each letter a number
abcdefghij 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
C=(P+K) mod26 U 20
“Y” C=(24+3)mod26
=27mod26 (27/26=1 with a remainder =1)
get the letter from the table that has the value of 1=“b”
“Y” = B
“o”=R
Caesar Cipher Algorithm
• Mathematically give each letter a number
abcdefghij 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
p=(c-K) mod26 X 23
“B” P=(1-3)mod26
=-2mod26 -2=-26+X X=24 “Y”
Figure 3.3
Brute-Force
Cryptanalysis
of
Caesar Cipher
(This chart can be found on page 71 in the
textbook)
Brute-Force Cryptanalysis-
TASK 1
LEVEL ONE: Level 2:
NVWE, K YCPV VQ GZRTGUU VJCV AQW BJKS, Y mqdj je unfhuii jxqj oek qhu iecu ev jxu ceij
CTG UQOG QH VJG OQUV GZEGRVKQPCN
U V W F G P V U K P V J G Y Q T N F. K H A Q W C T G unsufjyedqb ijktudji yd jxu mehbt. Yv oek qhu qrbu je huqt
CDNG VQ TGCF VJKU, KV OGCPU AQW jxyi, yj cuqdi oek xqlu qssecfbyixut jxu jqia, qdt veh jxqj,
JCXG CEEQORNKUJGF VJG VCUM, CPF HQT
V J C V, A Q W ' N N T G E G K X G C P C F F K V K Q P C N oek'bb husuylu qd qttyjyedqb cqha qi jxu vyhij edu je ieblu
OCTM CU VJG HKTUV QPG VQ UQNXG KV yj
Answer:
LTUC, I want to express that you are some of the most exceptional students in the world. If you are able to read this,
it means you have accomplished the task, and for that, you'll receive an additional mark as the first one to solve it
Sample of Compressed Text
Plain text H E L L O
7 4 11 11 14
Key Y O U Y o
24 14 20 24 14
P+k 31 18 31 35 28
18mod26= 31mod
(p+k)mod26 31-26= 5 9 2
18 26= 5
C F S F J c
Difficulties
• The one-time pad offers complete security but, in practice, has two fundamental
difficulties:
1. There is the practical problem of making large quantities of random keys.
• Any heavily used system might require millions of random characters on a regular basis.
2. Mammoth key distribution problem.
• For every message to be sent, a key of equal length is needed by both sender and receiver.
A block of plaintext
is treated as a
Typically a block
whole and used to
size of 64 or 128 bits
produce a
is used
ciphertext block of
equal length
The majority of
As with a stream network-based
cipher, the two symmetric
users share a cryptographic
symmetric applications make
encryption key use of block ciphers
11002 01102
1210 510
Decimal
0 14 0 14
1 4 1 3
2 13 2 4
3 1 3 8
4 2 4 1
5 15 5 12
6 11 6 10
7 8 7 15
8 3 8 7
9 10 9 13
10 6 10 9
11 12 11 6
12 5 12 11
13 9 13 2
14 0 14 0
15 7 15 5
Task 2 = ASCII table
Feistel Cipher
• Feistel proposed the use of a cipher that alternates substitutions and
permutations.
• Each plaintext element or group of elements is uniquely replaced by a
Substitutions corresponding ciphertext element or group of elements.
• the Feistel structure is used for Triple Data Encryption Algorithm (TDEA), which is one
of the two encryption algorithms (along with AES), approved for general use by the
National Institute of Standards and Technology (NIST).
• The Feistel structure is also used for several schemes for format-preserving
encryption, which have recently come into prominence.
• the Camellia block cipher is a Feistel structure; it is one of the possible symmetric
ciphers in TLS ( Transport layer Security) and a number of other Internet security
protocols.
Diffusion and Confusion
• Terms introduced by Claude Shannon to capture the two basic building blocks
for any cryptographic system
• Shannon’s concern was to thwart cryptanalysis based on statistical analysis
Diffusion
• The statistical structure of the plaintext is dissipated into long-range statistics of the
ciphertext
• This is achieved by having each plaintext digit affect the value of many ciphertext digits
Confusion
• Seeks to make the relationship between the statistics of the ciphertext and the value of
the encryption key as complex as possible
• Even if the attacker can get some handle on the statistics of the ciphertext, the way in
which the key was used to produce that ciphertext is so complex as to make it difficult to
deduce the key
Feistel Example (2)