Cryptographl Lect4

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

Cryptography

• can characterize by:


– type of encryption operations used
• substitution / transposition / product
– number of keys used
• single-key or private / two-key or public
– way in which plaintext is processed
• block / stream

1
Stream Ciphers & Block Ciphers
stream ciphers in which the key stream is the repeated value of the key.
In other words, the key stream is considered as a predetermined stream
of keys or K = (k, k, …, k). In this cipher, however, each character in the
ciphertext depends only on the corresponding character in the plaintext,
because the key stream is generated independently.
The monoalphabetic substitution ciphers is stream ciphers. However,
each value of the key stream in this case is the mapping of the current
plaintext character to the corresponding ciphertext character in the
mapping table.
In a block cipher, a group of plaintext symbols of size m (m > 1) are
encrypted together creating a group of ciphertext of the same size.
Playfair ciphers are block ciphers. The size of the block is m = 2. Two
characters are encrypted together.
Affine Cipher
 broaden to include multiplication
 can define affine transformation as:
c = E(k, p) = (ap + b) mod (26)
p = D(k, c) = (a-1(c – b)) mod (26)
 key k=(a,b)
 a must be relatively prime to 26
 so there exists unique inverse a-1
Affine Cipher
 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 z
example: encrpt the message using affine k=(7,2):
Message = GO
Encrption = SW
E(G) =(7*6+2)mod26 =44 mod 26 =18 =S
E(O) =(7*14+2)mod 26 =98+2-100 mod 26 =22=w
Affine Cipher - Example
 example k=(17,3):
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 z
= IN
D U L C T K B S J A R I Z Q H Y P G X O F W N E V M
= OUT
 example:
meet me after the toga party
ZTTO ZT DKOTG OST OHBD YDGOV
 Now how many keys are there?
 12 x 26 = 312
 Still can be brute force attacked!
Transposition ciphers(simply changes the order)
differ from the monoalphabetic ciphers (shift,
affine, and substitution)
In monoalphabetic ciphers, the letters are
changed by creating a new alphabet (the cipher
alphabet) and assigning new letters.
In transposition
ciphers, no new alphabet is created – the letters
of the plaintext are just rearranged is some
fashion.
Row Transposition Ciphers
 is a more complex transposition
 write letters of message out in rows over a
specified number of columns
 then reorder the columns according to some
key before reading off the rows
Key: 4312567
Plain text attack post poned until twoam
Column Out 4 3 1 2 5 6 7
Plaintext: a t t a c k p
o s t p o n e
d u n t i l t
w o a m x y z
Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
Simple Types of Transposition Ciphers

write the plaintext in a zig-zag – Rail Fence Cipher .1


pattern in two rows and form the ciphertext by
reading off the letters from the first row followed by
.the second
Rail Fence cipher
• write message letters out diagonally over a
number of rows
• then read off cipher row by row
• Meet me after the toga party
• eg. write message out as:
m e m a t r h t g p r y
e t e f e t e o a a t
• giving ciphertext
MEMATRHTGPRYETEFETEOAAT
12
Types of Cryptanalytic (breaking the code)Attacks
• ciphertext only
– only know algorithm / ciphertext, statistical approach, can identify
plaintext (English, French, Java file, Window EXE file)
• known plaintext
– know/suspect plaintext & ciphertext to attack cipher
• chosen plaintext
– select plaintext and obtain ciphertext to attack cipher
• chosen ciphertext
– select ciphertext and obtain plaintext to attack cipher
• chosen text
– select either plaintext or ciphertext to en/decrypt to attack cipher

13
Brute Force Search
always possible to simply try every key •
most basic attack, proportional to key size •
assume either know / recognise plaintext •

14
Product Ciphers
 ciphers using substitutions or transpositions are
not secure because of language characteristics
 hence consider using several ciphers in
succession to make harder, but:
 two substitutions make a more complex substitution
 two transpositions make more complex transposition
 but a substitution followed by a transposition makes a new
much harder cipher
 this is bridge from classical to modern ciphers
Classical Substitution Ciphers
• where letters of plaintext are replaced by
other letters or by numbers or symbols
• or if plaintext is viewed as a sequence of bits,
then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns

16
More Definitions
• unconditional security
– Ciphertext does not contain enough information to
determine uniquely the corresponding plaintext
– no matter how much time opponent has, or how much
Ciphertext is available.
• computational security
– given limited computing resources (eg time needed for
calculations is exceed the usefull lifetime of the
information), the cipher cannot be broken (or cost of
breaking the cipher exceeds the value of the encrypted
info.)

17
Steganography
Steganography is a method of hiding data in another
• media so that the data's very existence is concealed.
• an alternative to encryption
• hides existence of message
– using only a subset of letters/words in a longer message
marked in some way
– using invisible ink
– hiding in LSB in graphic image or sound file
• has drawbacks
– high overhead to hide relatively few info bits

18
ExE(2)
1-Affine Cipher
Encrypt the plaintext ‘how are you
if key = (5,7 )
2- Hill Cipher
Encrypt the plaintext : NETWORK
Key is 2 x 2 so we use
= Key
Row Transposition -2
,'WE ARE DISCOVERED. FLEE AT ONCE'
Key: 4312567

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