0% found this document useful (0 votes)
37 views28 pages

Ch3. Cryptography - Cipher 1 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views28 pages

Ch3. Cryptography - Cipher 1 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Cryptography

Jumana Khwaileh-LTUC
Learning Objectives

 Upon successful completion of this chapter, you will be understanding :

Caesar Cipher algorithms


Brute-Force Cryptanalysis of Caesar Cipher Algorithms
One-Time Pad
Block and Stream cipher.
Caesar Cipher
• Simplest and earliest known use of a substitution cipher.
• Used by Julius Caesar
• Involves replacing each letter of the alphabet with the letter standing
three places further down the alphabet
• Alphabet is wrapped around so that the letter following Z is A

 plain: meet me after the toga party


 cipher: PHHW PH DIWHU WKH WRJD SDUWB
Caesar Cipher Example
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 # 3
D E F G H J K L M N O P Q R S T U V W X Y Z A B C

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

• Algorithm can be expressed as:


c = E(3, p) = (p + 3) mod (26)
• A shift may be of any amount, so that the general Caesar algorithm is:
C = E(k , p ) = (p + k ) mod 26
• Where k takes on a value in the range 1 to 25; the decryption algorithm is simply:
p = D(k , C ) = (C - k ) mod 26
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

Example: Encrypt “HELLO” With caeser cipher with the key 3 H 7


find the value for each letter from the table above : E 4

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

Example: Encrypt “You” With caeser cipher with the key 3 Y 24


find the value for each letter from the table above : O 14

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

Example Decrypt“BRX” With caeser cipher with the key 3 B 1


find the value for each letter from the table above : R 17

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

Figure 3.4 Sample of Compressed Text


One-Time Pad
• Improvement to Vernam cipher proposed by an Army Signal Corp officer,
Joseph Mauborgne.
• Use a random key that is as long as the message so that the key need not
be repeated.
• Key is used to encrypt and decrypt a single message and then is discarded.
• Each new message requires a new key of the same length as the new
message
• Scheme is unbreakable.
• Produces random output that bears no statistical relationship to the plaintext
• Because the ciphertext contains no information whatsoever about the
plaintext, there is simply no way to break the code
One-Time Pad
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
Encrypt “ Hello”
Key: “you”

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.

• Because of these difficulties, the one-time pad is of limited utility.


• Useful primarily for low-bandwidth channels requiring very high security.
• The one-time pad is the only cryptosystem that exhibits perfect secrecy (see
Appendix F).
Stream Cipher
For practical reasons the bit-stream
In the ideal case, a one-time pad
generator must be implemented as
Encrypts a digital data stream one version of the Vernam cipher would
an algorithmic procedure so that
bit or one byte at a time be used, in which the keystream is as
the cryptographic bit stream can be
long as the plaintext bit stream
produced by both users

If the cryptographic keystream is


Examples: random, then this cipher is It must be computationally
impractical to predict future
• Autokeyed unbreakable by any means other
portions of the bit stream
than acquiring the keystream based on previous portions of
Vigenère cipher • Keystream must be provided to the bit stream
• Vernam cipher both users in advance via some
independent and secure channel
• This introduces insurmountable The two users need only
logistical problems if the share the generating key
intended data traffic is very large and each can produce the
keystream
Block Cipher

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

May be easier to see in the next slide


Encryption and Decryption Tables for Substitution Cipher of Figure 3.2
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.

• No elements are added or deleted or replaced in the sequence, rather


Permutation the order in which the elements appear in the sequence is changed.

• Is a practical application of a proposal by Claude Shannon to develop a product cipher


that alternates confusion and diffusion functions .
• Is the structure used by many significant symmetric block ciphers currently in use.
• Product Cipher: combines two or more transformations to encrypt data, aiming to
enhance security beyond what individual components can achieve.
Feistel Cipher

• 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)

Note the difference in


the L and R notations
and usage
Feistel Cipher Design Features
• Block size • Round function F
• Larger block sizes mean greater security but • Greater complexity generally means greater
reduced encryption/decryption speed for a resistance to cryptanalysis
given algorithm
• Fast software encryption/decryption
• Key size • In many cases, encrypting is embedded in
• Larger key size means greater security but applications or utility functions in such a way as to
may decrease encryption/decryption speeds preclude a hardware implementation; accordingly,
the speed of execution of the algorithm becomes
• Number of rounds
a concern
• The essence of the Feistel cipher is that a
single round offers inadequate security but • Ease of analysis
that multiple rounds offer increasing security • If the algorithm can be concisely and clearly
• explained, it is easier to analyze that algorithm for
Subkey generation algorithm
cryptanalytic vulnerabilities and therefore develop
• Greater complexity in this algorithm should
a higher level of assurance as to its strength
lead to greater difficulty of cryptanalysis
Feistel Example
Lab Work
• Write your full name as Characters
• Then Use Caesar cipher K= 3 to Encrypt it
• What you can do on the plain text to make it difficult to decrypt and encrypt your
name again by your own way
• Ex: Mohammad ALNimrat -> Prkdppdg DOQlpudw
• I will double each character: MMOOHHAAMMMMAADD AALLNNIIMMRRAATT
• PPRRKKDDPPPPDDGG DDOOQQLLPPUUDDWW

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy