Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
9 views73 pages

Unit-1 Part-2

sasasasasasas

Uploaded by

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

Unit-1 Part-2

sasasasasasas

Uploaded by

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

UNIT-1

PART-2
Cryptographic Techniques

Prepared By:
Dr. Somya Dubey
Cryptographic Techniques
 Encryption or cryptography—the name means secret writing.
 Cryptography is the art of achieving security by encoding messages to make them non-
readable.
 Cryptography conceals data against unauthorized access.
Basic Terminology
 plaintext - the original message
 ciphertext - the coded message
 cipher - algorithm for transforming plaintext to ciphertext
 key - info used in cipher known only to sender/receiver
 encipher (encrypt) - converting plaintext to ciphertext
 decipher (decrypt) - converting ciphertext to plaintext  (knowing the key)
 cryptography - study of encryption principles/methods
 cryptanalysis (code breaking) - the study of principles/ methods of deciphering
ciphertext without knowing key
 cryptology - the field of both cryptography and cryptanalysis

In other words:
• Cryptology  The art and science of making and breaking “secret codes”
• Cryptography  making “secret codes”
• Cryptanalysis  breaking “secret codes”
• Crypto  all of the above (and more)
Generic View

C = E(P) and P = D(C)


where C represents the Cipher text, E is the encryption rule,
P is the plaintext, and D is the decryption rule
 Basic assumptions
 The system is completely known to the attacker
 Only the key is secret
 That is, crypto algorithms are not secret .

 Why do we make such an assumption?


 Experience has shown that secret algorithms tend to be weak when exposed
 Secret algorithms never remain secret
 Better to find weaknesses beforehand
 Kerckhoffs’ Principle: Kerckhoff's principle is the concept that a
Cryptographic system should be designed to be secure, even if all its details,
except for the key, are publicly known.
 After a message has been subjected to a cryptographic algorithm, it is expected
to remain secure even if an intruder has or gains full access to the encrypted
message and has knowledge of what algorithm was used.
 The point is that, even if a system's design and details are not made open to
begin with, they may be detected by an unauthorized party and, as such, should
be inherently secure.
Types of Cryptography

 1. Symmetric-key cryptography: This type of cryptography involves the use of a single


key to encrypt and decrypt data. Both the sender and receiver use the same key, which
must be kept secret to maintain the security of the communication.
 2. Asymmetric-key cryptography: Asymmetric-key cryptography, also known as public-
key cryptography, uses a pair of keys – a public key and a private key – to encrypt and
decrypt data. The public key is available to anyone, while the private key is kept secret
by the owner.
 Hash functions: A hash function is a mathematical algorithm that converts data of any
size into a fixed-size output. Hash functions are often used to verify the integrity of data
and ensure that it has not been tampered with.
Symmetric key encryption
Key

Original
Plaintext Encryption Ciphertext Decryption
Plaintext

(a) Symmetric Cryptosystem

Encryption Decryption
Key Key

Original
Plaintext Encryption Ciphertext Decryption
Plaintext

(b) Asymmetric Cryptosystem


 A symmetric encryption scheme has five ingredients :
• Plaintext: This is the original message or data that is fed into the algorithm as input.
• Encryption algorithm: The encryption algorithm performs various substitutions
and transformations on the plaintext.
• Secret key: The secret key is also input to the encryption algorithm. The exact
substitutions and transformations performed by the algorithm depend on the key.
• Cipher text: This is the scrambled message produced as output. It depends on the
plaintext and the secret key. For a given message, two different keys will produce two
different cipher texts.
• Decryption algorithm: This is essentially the encryption algorithm run in reverse. It
takes the cipher text and the secret key and produces the original plaintext.

• There are two requirements for secure use of symmetric encryption:


• We need a strong encryption algorithm.
• Sender and receiver must have obtained copies of the secret key in a secure fashion
and must keep the key secure.
 Asymmetric Key Cryptography: Under this system a pair of keys is used to encrypt and
decrypt information. A receiver’s public key is used for encryption and a receiver’s private
key is used for decryption. Public key and Private Key are different. Even if the public key is
known by everyone the intended receiver can only decode it because he alone know his
private key. The most popular asymmetric key cryptography algorithm is RSA algorithm.
 A public-key encryption scheme has six ingredients:
 Plaintext: This is the readable message or data that is fed into the algorithm as
input.
 Encryption algorithm: The encryption algorithm performs various transformations on the
plaintext.
 Public and private key: This is a pair of keys that have been selected so that if one is used for
encryption, the other is used for decryption. The exact transformations performed by the
encryption algorithm depend on the public or private key that is provided as input.
 Ciphertext: This is the scrambled message produced as output. It depends on the plaintext
and the key. For a given message, two different keys will produce two different ciphertexts.
 Decryption algorithm: This algorithm accepts the ciphertext and the matching key and
produces the original plaintext.
Cryptographic Primitives
 Substitution

 One set of bits is exchanged for another

 Transposition

 Rearranging the order of the ciphertext to break any repeating patterns in the underlying plaintext

 Confusion

 An algorithm providing good confusion has a complex functional relationship between the
plaintext/key pair and the ciphertext, so that changing one character in the plaintext causes
unpredictable changes to the resulting ciphertext

 Diffusion

 Distributes the information from single plaintext characters over the entire ciphertext output, so that
even small changes to the plaintext result in broad changes to the ciphertext
12
 Cryptographic systems are generically classified along three independent dimensions:

1. The type of operations used for transforming plaintext to ciphertext. All


encryption algorithms are based on two general principles: substitution,
in which each element in the plaintext (bit, letter, group of bits or letters)
is mapped into another element, and transposition, in which elements
in the plaintext are rearranged. The fundamental requirement is that no
information be lost (i.e., that all operations be reversible). Most systems,
referred to as product systems, involve multiple stages of substitutions and
transpositions.
2. The number of keys used. If both sender and receiver use the same key, the
system is referred to as symmetric, single-key, secret-key, or conventional
encryption. If the sender and receiver each use a different key, the system is
referred to as asymmetric, two-key, or public-key encryption.
3. The way in which the plaintext is processed. A block cipher processes the input
one block of elements at a time, producing an output block for each input
block. A stream cipher processes the input elements continuously, producing
output one element at a time, as it goes along.
SUBSTITUTION TECHNIQUES

 Caesar Cipher
 Modified Version of Caesar Cipher
 Mono-alphabetic Cipher
 Homophonic Substitution Cipher
 Polygram Substitution Cipher
 Polyalphabetic Substitution Cipher
 Playfair cipher
 Hill 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 .
• For example, when key=3
• Replaces each letter by 3rd letter on
• Alphabet is wrapped around so that the letter following Z is A
• Example:
plain: meet me
cipher: PHHW PH
Caesar Cipher
 Define transformation as:
abcdefghijklmnopqrstuvwxyz
DE F GHIJ KLMNOPQR STUVWXYZAB C

 Mathematically give each letter a number


abcdefghijk l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y Z
13 14 15 16 17 18 19 20 21 22 23 24 25

 Then have Caesar cipher as:


C = E(p) = (p + k) mod (26)
p = D(C) = (C – k) mod (26)
Modified Version of Caesar Cipher
 It cab be k place down the line this can increase complexity.
 Once replacement scheme is decided, it would be constant for whole PT.
 25 possibilities of replacement.
 Brute force attack
 Measure Weakness Predictability
 Refer table on next slide
Mono-alphabetic Cipher
 RondomScheme of substitution Change
 No relation between the replacement of one to other.
 High number of possible permutation & combination.
 Mathematically (26*25*24*23*………………..2) or 4*10^26
 If the cipher text created with this technique is short

Letter frequency is a big clue


 e,t,a,o
most common English letters.
 Using a single key preserves frequency.
 There is only one hitch. If the cipher text created with this technique is short,
the cryptanalyst can try different attacks based on her knowledge of the English
language.
 As we know, some alphabets in the English language occur more frequently
than others.
 Language analysts have found that given a single alphabet in cipher text, the
probability that it is a P is 13.33%—the highest.
 After P comes Z, which is likely to occur 11.67%.
 The probability that the alphabet is C, K, L, N or R is almost 0—the lowest.
 A cryptanalyst looks for patterns of alphabets in a cipher text, substitutes the
various
 available alphabets in place of cipher text alphabets, and then tries her attacks.
 Apart from single-alphabet replacements, the cryptanalyst also looks for repeated
patterns of words to try the attacks. For example, the cryptanalyst might look for two-
alphabet cipher text patterns since the word to occurs very frequently in English.
 If the cryptanalyst finds that two alphabet combinations are found frequently in a
cipher text message, she might try and replace all of them with to, and then try and
deduce the remaining alphabets/words.
 Next, the cryptanalyst might try to find repeating three-alphabet patterns and try and
Homophonic substitution cipher

 To
escape frequency analysis, we can use a
homophonic substitution cipher
 Map symbols to multiple symbols.
 e.g 0 -> {01, 10}, 1->{00,11}
 Given Text 011010010 becomes: 011100101101011110
 Advantage: -Frequencies Hidden
 Disadvantage: -Message and Key are Longer
Polygram Cipher
 All previous techniques are based on stream cipher.
 Polygram is a block cipher.
 Following figure shows it
Poly-alphabetic Cipher
 Leon Battista invented in 1568.
 This cipher has been broken many times, and yet it has been used extensively.
 The Vigenere Cipher and the Beaufort Cipher are examples of it.
 It uses multiple one-character keys.
 Each of the keys encrypts one plain text character.
 The first key encrypts the first plain text character; the second key encrypts the
second plain text character, and so on.
 After all the keys are used, they are recycled.
 Thus, if we have 26 one-letter keys, every 26th character in the plain text would be
replaced with the same key.
 This number (in this case, 26) is called as the period of the cipher.
Example of Poly-alphabetic Cipher
 For key v & PT i , the corresponding CT is at the intersection of row titled v &
column titled i.
 Key repeats itself after n period
 For encryption “we need more supplies fast!”
1. Keyword :M E C M E CM E CM E CM E CM E CM E CM
2.Plaintext : w e n e e d m o r e s u p p l I e s f a s t
3.Ciphertext: I I P Q I F Y S S T Q W W B T U I U R E U F
Example of Poly-alphabetic Cipher
 For key v & PT i , the corresponding CT is at the intersection of row titled v &
column titled i.
 Key repeats itself after n period
 For encryption “we need more supplies fast!”
1. Keyword :M E C M E CM E CM E CM E CM E CM E CM
2.Plaintext : w e n e e d m o r e s u p p l I e s f a s t
3.Ciphertext: I I P Q I F Y S S T Q W W B T U I U R E U F
Play Fair Square
 Used for Manual Encryption Of Data

 Invented by Charles Wheatstone in 1854

 But known by Lord Playfair, who was friend of Charles Wheatstone.

 Playfair made this scheme popular & hence his name was used.

 Used by British Army in World War I

 Australians in World War II


Use
 Fast

 No equipments used.

 Important but not critical information.

 At the one could break it ->Value of information was nullified.

 Crosswords that appears in several Newspapers.


Play fair Encryption Scheme
 Uses to main processes

Playfair Cipher

Step 1:Creation & Population Of Matrix

Step2: Encryption Process


Step 1:Creation & Population Of
Matrix
 5*5 Matrix table
 Used to store keyword & phrase that becomes Key for Encryption &
Decryption.

1. Enter the keyword in the matrix row-wise: L->R


Top-to-bottom.
2. Drop duplicate letters.
3. Fill the remaining spaces in the matrix with the rest of the English
alphabets(A-Z) that was not the part of our keyword.
Note:-While doing so, combine I & J in the same cell of the table. If I & J is
the part of keyword, disregard both I & J while filling the remaining slots.
Step2: Encryption Process
1. PT broken into groups of two alphabets.
2. If both the alphabets are same OR only one is left, add an X after the first
alphabet. Using the new pair & continue.
3. If both the alphabets in the pair appear in the same row of our matrix, replace
them with the alphabets of their immediate right respectively. If the original pair
is on the right side of the row, then wrapping around to the left side of the row
happens.
4. If both the alphabets in the pair appear in the same column of our matrix, replace
them with the alphabets of their immediate below respectively. If the original pair
is on the bottom side of the row, then wrapping around to the top side of the row
happens.
Step2: Encryption Process

1. PT broken into groups of two alphabets.


2. If both the alphabets are same OR only one is left, add an X after the first
alphabet. Using the new pair & continue.
3. If both the alphabets in the pair appear in the same row of our matrix, replace
them with the alphabets of their immediate right respectively. If the original pair
is on the right side of the row, then wrapping around to the left side of the row
happens.
4. If both the alphabets in the pair appear in the same column of our matrix, replace
them with the alphabets of their immediate below respectively. If the original pair
is on the bottom side of the row, then wrapping around to the top side of the row
happens.
Continue…
5. If the alphabets are not in same row or column of our matrix, replace them with
the alphabets in the same row respectively , but the other pair of the corners of the
rectangle defined by the original pair, The order is quite significant here. The first
alphabet of the pair is the one that is present on the same row as the first plain text
alphabet.
 The process works in the opposite direction. We also need to remove the
extra X alphabets that we had added in step 1# above, if any.
 Keyword is: FAIR EXAMPLE.

F A I/J R E Table: Keyword


X M P L B Matrix

C D G H K
N O Q S T
U V W Y Z

 Plaintext: CYBER can be broken into CY BE R(X)


 For pair CY,does not in same row same column so fallow step 5
 CY, forms a rectangle CHYU so replace it with HU
 For pair BE both are in same column so replace it with immediate next in that
column i.e. KB
 Checking for R(X) form the rectangle FRLX so replace it with FL
Hill Cipher
 Works on multiple letters at the same time(i.e: Polygraphic).
 Lester Hill invented this in 1929.
 Its roots in Matrix Theory of Mathematics.
 Inverse of Matrix
 Attack:- Known Plain Text Attack
Encryption Steps
1. Treat every letter in PT message as a number, so that A=0,B=1,…….,Z=25.
2. The PT matrix organized as a number.
3. PT is multiplied by a randomly chosen keys. The key matrix consist of size n*n,
where n is the number of rows in PT.
4. Multiply the two matrix.
5. Now compute a mod26 value of the above matrix.
6. Now, translate the numbers to alphabets.
7. Ci=KPi mod26 where Ci and Pi are column vector and K is key
 E.g. encrypt the message “HEL” using the Hill cipher with the key
2 5 4
9 1 2
Ci = KPi Mod26
3 7 17

2 5 4 7
= 9 1 2 4 Mod 26
3 7 17 11

78
= 89 Mod 26
236

0
= 11 = 𝐴𝐿𝐶
2
Decryption Steps
1. CT matrix multiply it by the Inverse of original key Matrix.
2. Take mod26 of the above matrix.
3. Now, translate the numbers to alphabets
Transposition Ciphers

 A transposition cipher is one that permutes the symbols of the message


according to a preset pattern.
 Helps avoid detection of symbols based on correspondence.
 Said to increase diffusion
 Reduce redundancies in plaintext.
Rail Fence Technique(Keyless Transposition)
1. Write down the plain text message as a sequence of diagonals(i.e: zigzag sequence).
2. Read the text row-by-row, & write it sequentially.
 Original plain text message: Come home tomorrow

 have the cipher text as: Cmhmtmrooeoeoorw


 Simple too break
Simple Columnar Transposition Technique
 It simply arranges the plain text as a sequence of rows of a rectangle that are read in
columns randomly.
1. Write the plain text message row-by-row in a rectangle of a pre-defined size.
2. Read the message column-by-column. However, it need not be in the order of
columns 1,2, 3 etc. It can be any random order such as 2, 3, 1, etc.
3. The message thus obtained is the cipher text message.
 Trying out a few permutations and combinations of column orders quite simple to
break into.
 Original plain text message: Come home tomorrow
1. Let us consider a rectangle with six columns. Therefore, when we write the
message in the rectangle row-by-row(suppressing spaces), it would look as
follows

2. Now, let us decide the order of columns as some random order, say 4, 6, 1, 2, 5, 3.
Then read the text in the order of these columns.
3. we have the cipher text as: eowoocmroerhmmto.
 To add more complexity & twist using no. of iterations.
 Only one additional step is added is given below
 Repeat step 1 to 3 as many times as desired.
 E.g. Use Transposition cipher to encrypt the plain text “WE ARE THE BEST”
use key “HEAVEN”.
 Preparing the Key
h e a v e n
4 2 1 6 3 5
 Preparing the plaintext
W E A R E T
H E B E S T
 Encryption
a e e h n v
1 2 3 4 5 6
A E E W T R
B E S H T E
 Cipher text
 ABEEESWHTTRE
Vernam Cipher

 In 1920’s was first implemented at AT&T with the help of a device called as the
Vernam Machine.
 once an input cipher text for transposition is used, it is never used again
for any other message (hence the name one-time pad).
 Random set of non-repeating characters as the input cipher text key.
 Same length as message
 XORed with message
 Theoretically unbreakable
 Attacker can do no better than guessing
 Ciphertext gives no information about plaintext.
Vernam Cipher Algorithm
1. Treat each plain text alphabet as a number in an increasing sequence, i.e. A = 0, B =
1, …Z = 25.
2. Do the same for each character of the input cipher text.
3. each number corresponding to the plain text alphabet to the corresponding input
cipher text alphabet number.
4. If the sum thus produced is greater than 26, subtract 26 from it.
5. Translate each number of the sum back to the corresponding alphabet. This gives the
output cipher text.
Example of Vernam Cipher
Book Cipher/Running Key Cipher
 For producing cipher text, some portion of text from a book is used, which serves
the purpose of a one-time pad.
 Thus, the characters from a book are used as one-time pad, and they are added to
the input plain text message similar to the way a one-time pad works.
 It should be clear that since the one-time pad is discarded after a single use.
 This technique is highly secure and suitable for small plain text message, but is
clearly impractical for large messages.
SYMMETRIC AND ASYMMETRIC KEY
CRYPTOGRAPHY

 In symmetric-key cryptography, the same key is used by the sender(for encryption) and
the receiver (for decryption).
 The key is shared. Algorithm: DES,3DES.
Symmetric-key cryptography

 Advantages:
 Simple
 Faster
 Disadvantages:
 Key must exchanges in secure way
 Easy for hacker to get a key as it is passed in unsecure way.
• Asymmetric Key Cryptography (Public Key Cryptography)
– 2 different keys are used
– Users get the Key from an Certificate Authority

Advantages
1. More Secured
2. Authentication

Disadvantages
1. Relatively Complex
How it WORKS…….?
 Asymmetric encryption use two keys:

Public Key - to encrypt the data

Private Key - to decrypt the data

 These keys are generated together.

 The Public key(s) is distributed freely between the sender and receiver.

 The other is named as Private Key and it is kept hidden.

 The Private Key is only used for Decryption and will not be shared between the sender and receiver.
Symmetric key cryptography

 The sender and the receiver will use the same key to lock and unlock.
 the key distribution problem is inherently linked with the symmetric key operation.
Number of parties and correspondingly number of
lock-and-key pairs required:

for n persons, the number of lock-and-key pairs is n * (n – 1)/2


Diffie-Hellman Key Exchange/Agreement
Algorithm

 Whitefield Diffie and Martin Hellman devised an amazing solution to the problem of
key agreement, or key exchange in 1976. This solution is called as the Diffie-Hellman
Key Exchange/Agreement Algorithm.
 It is a key-exchange protocol that enables two parties communicating over public
channel to establish a mutual secret without it being transmitted over the Internet.
 Diffie-Hellman key exchange algorithm can be used only for key agreement, but not
for encryption or decryption of messages.
 Once both the parties agree on the key to be used, they need to use other symmetric key
encryption algorithms for actual encryption or decryption of messages.
Description of the algorithm
 Suppose Alice and Bob want to agree upon a key to be used for encryption / decryption message that would be
exchanged between them. Then diffie-hellman key exchange works as follows:

 1. Alice & bob agree on two large prime numbers: n and g


(note: these two integer need not be kept secret, insecure channel)
 2. Alice choose another large random number x and calculate A such
that,
A = gx mod n

 3. Alice send the number A to Bob.


 4. Bob independently choose another large random integer y and
calculate B such that,
B = gy mod n
 5. Bob send the number B to Alice.
 6. Alice, now compute the secret key K1 as follows: K1 = Bx mod n
Description of the algorithm
 7. Bob, now compute the secret key K2 as follows:
K2 = Ay mod n

 8. Surprise, K1=K2=K (which is symmetric key)


Example of the Diffie -Hellman algorithm

Large Prime Number

Alice n=11,g=7 Bob


Large Random Large Random
Number x=3 y=6 Number

A = 73 mod 11 B = 76 mod 11
=2 =4

B=4 A=2

K1 = 43 mod 11 K2 = 26 mod 11
=9 =9

K1 = K2 = K

Note: A,B,K1,K2 are Private to others


Mathematics Theory behind the algorithm
 1) Alice perform K1 Now what is B?
K1 = Bx mod n B = gy mod n
 If we put B value into K1 then,

K1 = (gy mod n)x mod n

K1 = gyx mod n

 2) Bob perform K2 K2 =Now


Ay mod
whatnis A? A = gx mod n

 If we put A value into K2 then,


K2 = (gx mod n)y mod n

K2 = gxy mod n

 Now Basic Mathematics says that,

Kyx = Kxy so that K1=K2=K (Proof)


Problem with the Algorithm
 Can diffie-hellman solve our problem associated with key exchange? Unfortunately, not quite!
 This algorithm fall into “man in the middle attack”
 This work as follows:
 Step-1:
 Alice want to communicate to Bob so as usual they use diffie-hellman key exchange so Let n=11 & g=7. they find K1 and
K2 .

 Step-2:
 Alice does not realize that the attacker TOM is listening the conversation between her and Bob.
 TOM simply pick up the value of n and g. (n=11,g=7)
 Alice n=11,g=7 TOM n=11,g=7 Bob n=11,g=7
 Step-3:
 Now let us assume that Alice, TOM & Bob select random number x & y as bellow:

x=3 x=8,y=6 y=9


 Alice TOM Bob
Problem with the Algorithm

 Step-4:
 Now all these person calculate the value of A and B.
A=gx mod n A=gx mod n B=gy mod n
=73 mod 11 =2 =78 mod 11 = 9 =79 mod 11 = 8
B=gy mod n
=76 mod 11 = 4

 Step-5:
Alice TOM TOM intercept Bob
A=2
The value of A A=9
And send Bob his
Own value of A

TOM intercept
B=4 The value of B B=8
And send Alice his
Own value of B
Problem with the Algorithm

 Step-6:
 So at last value of A,B to users are:
A=2,B=4* A=2,B=8 A=9*,B=8

* indicate value of A and B changed.


 Step-7:
 Based on these values, all the three person now calculate their Keys.

Alice TOM Bob

K1=Bx mod n K1=Bx mod n


=43 mod 11 =88 mod 11 K2=Ay mod n
=9 =5 =99 mod 11
K2=Ay mod n =5
=26 mod 11
=9

Solution: ? ( User authentication required )


Asymmetric Key Cryptography

 Two different keys are being used.


 One key (i.e. K1) can be used for locking, and only the corresponding other key (i.e.
K2) from the key pair can be used for unlocking.
 T is clearly defined here as a trusted third party. T is certified as a highly trustworthy
and efficient agency by the government.
 A public key infrastructure (PKI), in which one or more third parties – known as
certificate authorities – certify ownership of key pairs. This implies that the PKI system
(software, hardware, and management) is trust-able by all involved.
Stegnography
 Steganography is a technique that facilitates hiding of a message that is to be kept secret
inside other messages.
 It is often used in digital media, such as images, audio files, or text, to hide data within
them without arousing suspicion.
 It involve hiding data within images, audio files, or other digital media. Advanced
steganography methods use algorithms to embed data in a way that's difficult to detect
without specialized tools.
 Steganography can be used for legitimate purposes, it can also be used for malicious
activities, so it's important to use it ethically and responsibly.
Types Of Steganography
 Image Steganography
 Audio Steganography
 Video Steganography
 Text Steganography
 Network Steganography
 File Steganography
 Digital Watermarking
 Printed Steganography
 Social Media Steganography
 Hybrid Steganography
KEY RANGE AND KEY SIZE

The cryptanalyst is armed with the following information:


 The encryption/decryption algorithm
 The encrypted message
 Knowledge about the key size (e.g. the value of the key is a number between 0 and 100
billion)

* (If the key is found, the attacker can resolve the mystery by working backwards to the
original plain text message.)
KEY RANGE AND KEY SIZE

 Mathematics tells us that on an average, the key can be found after about Half of the possible values
in the key range are checked.
 In computer terms, the concept of key range leads us to the principle of key size.
 In order to protect ourselves against a brute force attack, the key size should be such that the attacker
cannot crack it within a specified amount of time.
Efforts required to break a key

* 512-bit keys will always be safe


POSSIBLE TYPES OF ATTACKS
 Cipher text only attack: In this type of attack, the attacker does not have any clue
about the plain text. She has some or all of the cipher text. Based on the frequency of
letters (e.g. the alphabets e, i, a are very common in English, etc.) the attacker makes an
attempt to guess the plain text.
 Known plain text attack: In this case, the attacker knows about some pairs of plain
text and corresponding cipher text. Using this information, the attacker tries to find
other pairs, and therefore, know more and more of the plain text.
 Chosen plain text attack: Here, the attacker selects a plain text block, and tries to look
for the encryption of the same in the cipher text.

You might also like