SlideShare a Scribd company logo
18CS744-CRYPTOGRAPHY
Module 1
By:
Asst.Prof Mona
Dept of CSE, BNMIT
How to speak crypto
• Cryptology-the art and science of making
and breaking “secret codes”
• Cryptography- the making of secret codes
• Crypto- a synonym for all the above.
The Cast of Characters
• Alice and Bob are the good guys
 Trudy is the bad “guy”
 Trudy is our generic “intruder”
• Classical Encryption
Techniques
• Symmetric Cipher model
• Substitution techniques
1.Symmetric Cipher Model (Conventional encryption)
• A symmetric encryption scheme has five
ingredients
1. Plaintext
2. Encryption algorithm
3. Secret key
4. Ciphertext
5. Decryption algorithm
• Two basic requirements of encryption are:
1. Encryption algorithm should be strong.
2. The key shared by the sender and the receiver
should be secret.
Model of Symmetric Cryptosystem
• Let the plaintext be X = [X1, X2,…, XM],
• key be K = [K1, K2,…, KJ]
• Cipher text produced be Y = [Y1, Y2,…, YN].
• Then = ( , X)
𝑌 𝐸 𝐾
• Here E is encryption algorithm and a function of plaintext X
and key K.
• The receiver at the other ends decrypts the cipher text using
the key. X = ( , )
𝐷 𝐾 𝑌
• Here D is decryption algorithm and it inverts the
transformations of encryption algorithm.
• An opponent not having access to X or K may
attempt to recover K or X or both.
• It is assumed that the opponent knows the
encryption (E)
• If the opponent is interested in only this particular
message, then the focus of the effort is to recover by
generating a plaintext estimate ^X.
• If the opponent is interested in being able to read
future messages as well then he will attempt to
recover the key by making an estimate ^𝐾.and
decryption (D) algorithms.
Cryptographic systems are characterized
along 3 independent dimensions:
1. The types of operations used for transforming
plaintext to ciphertext.
• All encryption algorithms are based on two general
principles substitution, and transposition.
• Basic requirement is that no information be lost.
• Most systems referred to as product system,
involves 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 use different keys 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 process a block at a time and
produce an output block for each input block.
• A stream cipher process the input element
continuously, producing output one element
at a time, as it goes along.
Mod1 basics cryptography first module vtu
Mod1 basics cryptography first module vtu
Cryptanalysis and Brute-Force
Attack
Cryptanalysis:
• Cryptanalytic attacks rely on the nature of the
algorithm plus perhaps some knowledge of the
general characteristics of the plaintext or even
some simple plaintext-ciphertext pairs.
• This type of attack finds characteristics of the
algorithm to find a specific plaintext or to find key
Brute-force attack: The attacker tries every possible
key on a piece of ciphertext until plaintext is obtained.
• For example, there may be a standardized
header or banner to an electronic funds
transfer message and the attacker can use
that for generating plaintext-cipher text pairs.
Chosen plaintext: If the analyst is able
somehow to get the source system to insert
into the system a message chosen by the
analyst, then a chosen-plaintext attack is
possible.
In such a case, the analyst will pick patterns
that can be expected to reveal the structure of
the key.
•Chosen Cipher text: In this attack, the
analyst has cipher text and some plaintext-
cipher text pairs where cipher text has been
chosen by the analyst.
o Chosen Text: Here, the attacker has got
cipher text, chosen plaintext-cipher text pairs
and chosen cipher text-plaintext pairs.
Mod1 basics cryptography first module vtu
•Therefore, all that the users of an encryption algorithm can strive
for is an algorithm that meets one or both of the following criteria:
• The cost of breaking the cipher exceeds the value of the encrypted
information.
• The time required to break the cipher exceeds the useful lifetime of the
information.
2. Substitution Techniques
(Classical encryption techniques)
• It is one in which the letters of plaintext are
replaced by other letters or by numbers or
symbols.
• 2 basic blocks of all encryption techniques:
1. Substitution
2. Transposition
1.Caesar cipher
• The encryption rule is simple; replace each letter of
the alphabet with the letter standing 3 places further
down the alphabet.
• The alphabet is wrapped around so that Z follows A.
• Generally Plain text is in lower case and Cipher text
is Upper Case.
Here, the key is 3. If different key is used,
different substitution will be obtained.
• Mathematically, starting from a=0, b=1 and so on,
Caesar cipher can be written as:
C=E( ,k) = ( + ) mod (26)
𝑝 𝑝 𝑘
Where k takes values in range 1 to 25
• Example: C=E( ,3) = ( + 3) mod (26)
𝑝 𝑝
• Decryption:p=D(k,C) = (C – ) mod (26)
𝑘
Mod1 basics cryptography first module vtu
By applying Brute Force
attack as there are only
25 possible Solutions.
2.Monoalphabetic Cipher
• Instead of shifting alphabets by fixed amount as in
Caesar cipher, any random permutation is assigned
to the alphabets. This type of encryption is called
monoalphabetic substitution cipher.
• For example, A is replaced by Q, B by D, C by T etc.
then it will be comparatively stronger than Caesar
cipher.
• Brute Force attack is impractical in this case.
• However, another attack is possible. Human
languages are redundant i.e. certain
characters are used more frequently than
others. This fact can be exploited.
• In English ‘e’ is the most common letter followed
by ‘t’, ‘r’, ‘n’, ’o’, ‘a’ etc. Letters like ‘q’, ‘x’, ‘j’ are
less frequently used.
• digrams like ‘th’ and trigrams like ‘the’ are also
more frequent.
• Tables of frequency of these letters exist.
These can be used to guess the plaintext if
the plaintext is in uncompressed English
language.
• The most common two letter combinations
are called as digrams. e.g. th, in, er, re and
an. The most common three letter

combinations are called as trigrams. e.g. the,
ing, and, and ion
3. Playfair Cipher
• Best known multiple letter
encryption cipher is playfair
• In this technique multiple (2)
letters are encrypted at a time.
• This technique uses a 5 X 5
matrix which is also called key
matrix. Constructed using a
keyword.
Example:
• Matrix is filled from L to R.
• 1st
key word filled without repetition of letters,
followed by remaining letters.
• 5X5=25
• English letters 26
The plaintext is encrypted two letters at a time
according to the following rules:
1. Break the plaintext into pairs of two consecutive
letters. If a pair is a repeated letter, insert a
filler like ‘X‘ in the plaintext,
Eg:"Balloon" is treated as "ba lx lo on".
2. If both letters fall in the same row of the key
matrix, replace each with the letter to its right
(wrapping back to start from end), eg. “AR"
encrypts as "RM".
2. If both letters fall in the same column,
replace each with the letter below it (again
wrapping to top from bottom), eg. “MU"
encrypts to "CM".
3. Otherwise each letter is replaced by the
one in its row in the column of the other
letter of the pair, eg. “HS" encrypts to "BP",
and “EA" to "IM" or "JM" (as desired)
Example 2:
PlainText: "instruments"
keyword: monarchy
After Split: 'in' 'st' 'ru' 'me' 'nt'
'sz' cipher text : ga tl mz cl rq tx
Example:
Keyword Hellothere
Plain text: Playfair
Mod1 basics cryptography first module vtu
4. Hill Cipher
• This cipher is a polygraphic substitution cipher based
on Linear Algebra.
• The algorithm uses matrix calculations : matrix
multiplication, modulo calculation, and the
inverse calculation of matrices.
• Every letter (A-Z) is represented by a number moduli
26 , where A = 0, B = 1, C = 2…Z = 25 in order to
use 2x2 key matrix.
NOTE: The complexity of the algorithm increases with the size
of the key matrix.
To ENCRYPT the text using hill cipher, we need to
perform the following operation
E(K, P) = (K * P) mod 26
Where K is the key matrix and P is plain text
in vector form.
Matrix multiplication of K and P generates the
encrypted ciphertext.
DECRYPT
D(K, C) = (K-1
* C) mod 26
Where K is the key matrix and C is the
ciphertext in vector form.
Matrix multiplication of inverse of key matrix K
and ciphertext C generates the decrypted plain
text.
Mod1 basics cryptography first module vtu
Step 1: key text (2x2) is DCDF.
Convert this key using a
substitution scheme into
a 2x2 key matrix.
Step 2: Convert plain text
into vector form.
key matrix is 2x2, the vector
must be 2x1 for matrix
multiplication.
(Suppose the key matrix is
3x3, a vector will be a 3x1
matrix.)
plain text is TEXT that is
four letters long word; thus
we can put in a 2x1 vector
and then substitute
ENCRYPTION
Step 3: Multiply the key matrix with each 2x1 plain
text vector, and take the modulo of result (2x1
vectors) by 26. Then concatenate the results
we get the encrypted or ciphertext as RGWL.
Step 1: Calculate the inverse of the key matrix.
Note: Here, Extended Euclidean algorithm is used to get
modulo multiplicative inverse of key matrix determinant
DECRYPTION
• The Euclidean algorithm is a
way to find the greatest
common divisor of two
positive integers. (largest
number that divides both of
them).
• A simple way to find GCD is
to factorize both numbers
and multiply common prime
factors.
• Extended Euclidean
algorithm also finds integer
coefficients x and y such
that:
ax + by = gcd(a, b)
Determinant of a matrix
Reference:
https://www.studypug.com/algebra-help/the-
determinant-of-a-3-x-3-matrix-general-and-shortcut-
method
Mod1 basics cryptography first module vtu
Mod1 basics cryptography first module vtu
Step 2: Now, we multiply the 2x1 blocks of
ciphertext and the inverse of the key matrix. The
resultant block after concatenation is the plain text
that we have encrypted i.e., TEXT.
5.Polyalphabetic Cipher
• A polyalphabetic cipher is any cipher based on
substitution, using multiple substitution
alphabets.
• Vigenere Cipher is a method of encrypting
alphabetic text which uses a simple form of
polyalphabetic substitution
• The encryption of the original text is done using
the Vigenère square or Vigenère table.
1. The table consists of the alphabets written out 26
times in different rows, each alphabet shifted
cyclically to the left compared to the previous
alphabet, corresponding to the 26 possible
Caesar Ciphers.
2. At different points in the encryption process, the
cipher uses a different alphabet from one of the
rows.
3. The alphabet used at each point depends on a
repeating keyword.
Mod1 basics cryptography first module vtu
• To encrypt a message, a key is needed that is as
long as the message. Usually, the key is a
repeating keyword.
• Encryption can be done by looking in the Vigenere
Table where ciphertext is the letter key’s row and
plaintext’s column or by the following formula:
𝐶i = ( i + i o ) o 26
𝑃 𝐾 𝑚 𝑑 𝑚 𝑚 𝑑
• .
• Decryption : The key letter again identifies
the row. The position of the cipher text letter
in that row determines the column, and the
plaintext letter is at the top of that column.
• The strength of this cipher is that there
are multiple ciphertext letters for each
plaintext letter, one for each unique letter
of the keyword
Vernam Cipher
• This system works on binary data (bits) rather than
letters.
• The technique can be expressed as follows:
• The ciphertext is
generated by performing
the bitwise XOR of the
plaintext and the key.
Vernam Encryption and Decryption
• A=0……Z=25
• ABCD0 1 2 3
• Key=length of plain key
• Substitute key values
aging following A=0……
Z=25
• Now add plain text to key
• Addition number > 25
then subtract that
number form 26.
• Resultant – convert
numbers to alphabets 
cypher text
• Use cypher text and
key.
• Subtract key from
cypher text
• If (Cypher – key) is
negative number
then add 26 to it
• Resultant number
substitute with its
respective letter
values.
6. One-Time Pad
• It is a system in which a randomly generated private
key is used only once to encrypt a message that is
then decrypted by the receiver using a matching one-
time pad and key.
• The 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.
• This scheme is unbreakable.
• It produces random output that bears no
statistical relationship to the plaintext.
• The one-time pad is used where very high
security is required.
• The one-time pad is the only cryptosystem
that exhibits perfect secrecy.
• Because the ciphertext contains no information
whatsoever about the plaintext, there is simply no
• The one-time pad offers complete security but, in
practice, hastwo 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. Supplying truly
random characters in this volume is a significant
task.
2. Another problem is that of key distribution
and protection. For every message to be
sent, a key of equal length is needed by
both sender and receiver. way to break the
code.
Block Ciphers and the data
encryption standard
Symmetric Cryptography
• Block ciphers process messages into blocks, each
of which is then en/decrypted
 Like a substitution on very big characters  64-bits
or more
• Stream ciphers process messages a bit or byte at a
time when en/decrypting
Many current ciphers are block ciphers
 Better analyzed.
 Broader range of applications.
Mod1 basics cryptography first module vtu
Block Cipher Principles
• Block ciphers look like an extremely large
substitution
• Would need table of 2 Power 64 entries for a 64-bit
block
• Arbitrary reversible substitution cipher for a large
block size is not practical – 64-bit general
substitution block cipher, key size 2 Power 64!
• Most symmetric block ciphers are based on a
Feistel Cipher Structure
• Needed since must be able to decrypt ciphertext to
recover messages efficiently
• In an ideal block cipher, the relationship between the input
blocks and the output block is completely random. But it must
be invertible for decryption to work.
• Hence, it has to be one-to- one, meaning that each input block
is mapped to a unique output block.
• The mapping from the input bit blocks to the output bit blocks
can also be construed as a mapping from the
integers corresponding to the input bit blocks to the integers
corresponding to the output bit blocks.
• The encryption key for the ideal block cipher is
the codebook itself, meaning the table that shows the
relationship between the input blocks and the output
blocks
n=4 16 possible input states
Problems with Ideal Block Cipher
• If a small block size, such as n = 4, is used, then the
system is equivalent to a classical substitution
cipher.
 Such systems are vulnerable to a statistical analysis
of the plaintext.
 This weakness is not inherent in the use of a
substitution cipher but rather results from the use of
a small block size.
• If n is sufficiently large and an arbitrary reversible
substitution between plaintext and ciphertext is
allowed, then the statistical characteristics of the
source plaintext are masked to such an extent that
this type of cryptanalysis is infeasible.
Mod1 basics cryptography first module vtu
Feistel Cipher
• Feistel cipher is a structure based on the Shannon
structure.
• The Shannon structure shows the implementation of
confusion and diffusion alternately.
• Confusion fabricates a complex relation between
the cipher text and encryption key by implementing a
complex substitution algorithm.
• .
• Whereas, the diffusion fabricates a complex
relation between plain text and cipher
text by implementing more
complex permutation algorithm.
• The Shannon structure was successful in
achieving a more complex block cipher and
thus confusion and diffusion were adopted
by the Feistel structure
Feistel Cipher Structure
• Feistel cipher proposed a structure which
implements substitution and permutation alternate
ly to obtain cipher text from the pain text and vice-
versa.
• In the Feistel block cipher, each block has to
undergo many rounds where each round has the
same function.
• Substitution is implemented by replacing
the elements of plain text or the set of
elements of plain text by the element of
cipher text or set of elements of cipher
text.
• A permutation is implemented by changing
the order of elements of the plain text. No
element here is replaced by any other
element, only the order of elements is
changed.
The Feistel cipher structure above follows the steps
below:
1. Convert plain text into binary using ASCII codes of
each character.
2. Divide the data into blocks, processed one at a
time.
3. The encryption process takes two inputs, one block
of data and a master key.
4. When the block is ready for the encryption process,
divide it into two halves of equal length. The left
half is denoted by Lo​and the right half is
characterized by Ro
5. Data is passed through n rounds of execution,
where the n is specified by the design of the
algorithm.
6. Each round uses the same encryption function and
a different sub key generated from the master key.
7. To generate the left half of the next round, Li+1​
, the
current right half, Ri​is assigned to it.
8. To generate the right half of the
next round, Ri+1​
, the current right
half, Ri​undergoes the following
steps:
– Ri​and the subkeyi is passed
through an encryption
function.
– The result from above step is
XORed with the left half of the
current round, Li​
.
– The result from step 2 is
assigned to the right half of
the next round, Ri+1​
.
9. The left and right half of data
obtained after n rounds of
execution is swapped again
before concluding the Feistel
cipher.
Feistel Decryption Algorithm
Feistel Cipher structure does not have
a different algorithm for decryption.
The encryption and decryption function
proposed by Feistel cipher are same
with some rules which are as follows:
1. The input to the decryption
algorithm is a cipher text block
produced by the encryption
algorithm.
2. The sequence of subkeys used in
encryption are reversed. The key
Kn is used in the first round of
decryption, key Kn-1 in the second
round of decryption and so on, until
the last round occurs where key
K1 is used.
The design features of Feistel cipher considered while
implementing any block cipher are as follow:
• Block Size
The block cipher is considered more secure if the block size is
larger. But the larger block size can reduce the execution speed of
encryption and decryption. Generally, the block size of a block
cipher is of 64-bit. But, the modern-day block cipher such as
AES has 128-bit block size.
• Key Size
The security of block cipher increases with the increasing key
size. But the large key size may decrease the speed of encryption
and decryption. Earlier the key of 64-bit was considered to
adequate. But the modern cipher uses a key of size 128-bit.
• Number of rounds
The number of rounds also increases the security
of the block cipher. More are the number of
rounds more complex is the cipher.
• Subkey generation function
More the subkey generation function is complex,
difficult it is for a cryptanalyst to crack it.
• Round Function
Complex round function enhances the security of
the block cipher.
Considerations in design of a Feistel Cipher.
• Fast Software Encryption/Decryption
The block cipher is implemented in a software
application to achieve better execution speed.
• Easy Analysis
The block cipher algorithm should be easy to
analyze because it would ease in analyzing the
cryptanalytic weakness and develop more
strength in the algorithm.
• DES
The data encryption standard
• DES is a symmetric-key block cipher published by
the National Institute of Standards and Technology
(NIST).
• DES is an implementation of a Feistel Cipher. It
uses 16 round Feistel structure.
• The block size is 64-bit. Though, key length is 64-
bit, DES has an effective key length of 56 bits,
since 8 of the 64 bits of the key are not used by the
encryption algorithm
• DES uses 16 rounds of the Feistel structure, using
a different key for each round
Permuted
input
Bit swaped
–peroutput
Preoutput passed through inverse of
initial permutation to produce 64 bit
cyphertext
Subkey Ki
https://page.math.tu-berlin.de/~kant/teaching/hess/krypto-ws2006/
des.htm#:~:text=For%20example%2C%20if%20we%20take,the
%20original%20plaintext%20%228787878787878787%22.
DES Example
http://www.umsl.edu/~siegelj/information_theory/projects/
des.netau.net/Dataencryptionalgorithm.html
http://www.student.apamaravathi.in/meterials/cns/UNIT
%202%20CNS_MVR%20College%20of%20Engineering%20and
%20technologybyD.Srinivas.pdf
Mod1 basics cryptography first module vtu
THE STRENGTH OF DES
1. Use of 56 Bit Keys
2. Nature of DES Algorithm
3. Timing Attacks
Mod1 basics cryptography first module vtu
trength of DES : Nature of DES Algorithm
Mod1 basics cryptography first module vtu
Block cipher design principles
Block cipher has a specific number of rounds and keys for
generating ciphertext.
1. Number of Rounds –The number of Rounds to be
suitable for an algorithm to make it more complex, in DES
we have 16 rounds ensuring it to be more secure while in
AES we have 10 rounds
2. Design of function F –The core part of the Feistel Block
cipher structure is the Round Function.
• The complexity of cryptanalysis can be derived from the
Round function i.e. the increasing level of complexity for the
round function  increase in complexity.
• To increase the complexity of the round function, the
avalanche effect is also included in the round function, as
the change of a single bit in plain text would produce a
mischievous output due to the presence of avalanche effect.
3. Key schedule algorithm –In Feistel Block
cipher structure, each round would
generate a sub-key for increasing the
complexity of cryptanalysis.
• The Avalanche effect makes it more complex
in deriving sub-key. Decryption must be done
very carefully to get the actual output as the
avalanche effect is present in it.
Mod1 basics cryptography first module vtu

More Related Content

PPTX
Module 1.pptx
PPTX
MODULE1_CLASSICALENCRYPTIONTECHNIQUES.pptx
PPTX
Information security (Symmetric encryption, cryptography, crypto-analysis)
PDF
Classical encryption techniques
PPTX
Symmetric Encryption Techniques
PPTX
Information security powerpoint presentation
PPTX
Cryptography and Network Security--MOD-2.pptx
PPTX
Unit 3 -Symmetric Key Cryptographic Algorithms – I.pptx
Module 1.pptx
MODULE1_CLASSICALENCRYPTIONTECHNIQUES.pptx
Information security (Symmetric encryption, cryptography, crypto-analysis)
Classical encryption techniques
Symmetric Encryption Techniques
Information security powerpoint presentation
Cryptography and Network Security--MOD-2.pptx
Unit 3 -Symmetric Key Cryptographic Algorithms – I.pptx

Similar to Mod1 basics cryptography first module vtu (20)

PPTX
SYMMETRIC CYPHER MODELS WITH SUITABLE DIAGRAM.pptx
PDF
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
PPTX
forth lecture of the information retrieval and management partB_2025.pptx
PPTX
Cryptography cryptography CryptographyCryptography
PPTX
Classical encryption techniques
PPT
cryptography.ppt
PPTX
Information system security Unit 2.pptx
PPTX
security Symmetric Key Cryptography Substitution Cipher, Transposition Cipher.
PPTX
Secret key cryptography
PPTX
4.SUBSTITUTION TECHNIQUES-1.pptxjjggddssadssdddf
PPTX
1_Cryptanalysis for graduate course.pptx
PDF
IS_Classical-Encryption-Techniques_5.pdf
PPT
Computer systems security 7-cryptography.ppt
PPTX
ServerDecwweddgccgccfgvxgxcvfxvhfxvr.pptx
PPTX
IANSunit 1_cryptography_2.pptxv xvxvxvxv
PPT
EncryptionTechChap2.ppt
PPTX
cryptographyandnetworksecu-module-1.pptx
PPT
CryptographyCryptographyCryptography.ppt
PPT
encryptcryptographyyyyyyyyyyyyyyyyyy.ppt
PDF
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
SYMMETRIC CYPHER MODELS WITH SUITABLE DIAGRAM.pptx
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
forth lecture of the information retrieval and management partB_2025.pptx
Cryptography cryptography CryptographyCryptography
Classical encryption techniques
cryptography.ppt
Information system security Unit 2.pptx
security Symmetric Key Cryptography Substitution Cipher, Transposition Cipher.
Secret key cryptography
4.SUBSTITUTION TECHNIQUES-1.pptxjjggddssadssdddf
1_Cryptanalysis for graduate course.pptx
IS_Classical-Encryption-Techniques_5.pdf
Computer systems security 7-cryptography.ppt
ServerDecwweddgccgccfgvxgxcvfxvhfxvr.pptx
IANSunit 1_cryptography_2.pptxv xvxvxvxv
EncryptionTechChap2.ppt
cryptographyandnetworksecu-module-1.pptx
CryptographyCryptographyCryptography.ppt
encryptcryptographyyyyyyyyyyyyyyyyyy.ppt
Caesar Cipher , Substitution Cipher, PlayFair and Vigenere Cipher
Ad

Recently uploaded (20)

PDF
Complications of Minimal Access Surgery at WLH
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Lesson notes of climatology university.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
Complications of Minimal Access Surgery at WLH
O5-L3 Freight Transport Ops (International) V1.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Yogi Goddess Pres Conference Studio Updates
Final Presentation General Medicine 03-08-2024.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Orientation - ARALprogram of Deped to the Parents.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
2.FourierTransform-ShortQuestionswithAnswers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Cell Structure & Organelles in detailed.
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Lesson notes of climatology university.
Microbial diseases, their pathogenesis and prophylaxis
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Final Presentation General Medicine 03-08-2024.pptx
O7-L3 Supply Chain Operations - ICLT Program
Ad

Mod1 basics cryptography first module vtu

  • 2. How to speak crypto • Cryptology-the art and science of making and breaking “secret codes” • Cryptography- the making of secret codes • Crypto- a synonym for all the above.
  • 3. The Cast of Characters • Alice and Bob are the good guys  Trudy is the bad “guy”  Trudy is our generic “intruder”
  • 5. • Symmetric Cipher model • Substitution techniques
  • 6. 1.Symmetric Cipher Model (Conventional encryption)
  • 7. • A symmetric encryption scheme has five ingredients 1. Plaintext 2. Encryption algorithm 3. Secret key 4. Ciphertext 5. Decryption algorithm • Two basic requirements of encryption are: 1. Encryption algorithm should be strong. 2. The key shared by the sender and the receiver should be secret.
  • 8. Model of Symmetric Cryptosystem
  • 9. • Let the plaintext be X = [X1, X2,…, XM], • key be K = [K1, K2,…, KJ] • Cipher text produced be Y = [Y1, Y2,…, YN]. • Then = ( , X) 𝑌 𝐸 𝐾 • Here E is encryption algorithm and a function of plaintext X and key K. • The receiver at the other ends decrypts the cipher text using the key. X = ( , ) 𝐷 𝐾 𝑌 • Here D is decryption algorithm and it inverts the transformations of encryption algorithm.
  • 10. • An opponent not having access to X or K may attempt to recover K or X or both. • It is assumed that the opponent knows the encryption (E) • If the opponent is interested in only this particular message, then the focus of the effort is to recover by generating a plaintext estimate ^X. • If the opponent is interested in being able to read future messages as well then he will attempt to recover the key by making an estimate ^𝐾.and decryption (D) algorithms.
  • 11. Cryptographic systems are characterized along 3 independent dimensions: 1. The types of operations used for transforming plaintext to ciphertext. • All encryption algorithms are based on two general principles substitution, and transposition. • Basic requirement is that no information be lost. • Most systems referred to as product system, involves multiple stages of substitutions and transpositions.
  • 12. 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 use different keys the system is referred to as asymmetric, two-key, or public-key encryption
  • 13. 3. The way in which the plaintext is processed. • A block cipher process a block at a time and produce an output block for each input block. • A stream cipher process the input element continuously, producing output one element at a time, as it goes along.
  • 16. Cryptanalysis and Brute-Force Attack Cryptanalysis: • Cryptanalytic attacks rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some simple plaintext-ciphertext pairs. • This type of attack finds characteristics of the algorithm to find a specific plaintext or to find key Brute-force attack: The attacker tries every possible key on a piece of ciphertext until plaintext is obtained.
  • 17. • For example, there may be a standardized header or banner to an electronic funds transfer message and the attacker can use that for generating plaintext-cipher text pairs.
  • 18. Chosen plaintext: If the analyst is able somehow to get the source system to insert into the system a message chosen by the analyst, then a chosen-plaintext attack is possible. In such a case, the analyst will pick patterns that can be expected to reveal the structure of the key.
  • 19. •Chosen Cipher text: In this attack, the analyst has cipher text and some plaintext- cipher text pairs where cipher text has been chosen by the analyst. o Chosen Text: Here, the attacker has got cipher text, chosen plaintext-cipher text pairs and chosen cipher text-plaintext pairs.
  • 21. •Therefore, all that the users of an encryption algorithm can strive for is an algorithm that meets one or both of the following criteria: • The cost of breaking the cipher exceeds the value of the encrypted information. • The time required to break the cipher exceeds the useful lifetime of the information.
  • 22. 2. Substitution Techniques (Classical encryption techniques) • It is one in which the letters of plaintext are replaced by other letters or by numbers or symbols. • 2 basic blocks of all encryption techniques: 1. Substitution 2. Transposition
  • 23. 1.Caesar cipher • The encryption rule is simple; replace each letter of the alphabet with the letter standing 3 places further down the alphabet. • The alphabet is wrapped around so that Z follows A. • Generally Plain text is in lower case and Cipher text is Upper Case.
  • 24. Here, the key is 3. If different key is used, different substitution will be obtained.
  • 25. • Mathematically, starting from a=0, b=1 and so on, Caesar cipher can be written as: C=E( ,k) = ( + ) mod (26) 𝑝 𝑝 𝑘 Where k takes values in range 1 to 25 • Example: C=E( ,3) = ( + 3) mod (26) 𝑝 𝑝 • Decryption:p=D(k,C) = (C – ) mod (26) 𝑘
  • 27. By applying Brute Force attack as there are only 25 possible Solutions.
  • 28. 2.Monoalphabetic Cipher • Instead of shifting alphabets by fixed amount as in Caesar cipher, any random permutation is assigned to the alphabets. This type of encryption is called monoalphabetic substitution cipher. • For example, A is replaced by Q, B by D, C by T etc. then it will be comparatively stronger than Caesar cipher.
  • 29. • Brute Force attack is impractical in this case. • However, another attack is possible. Human languages are redundant i.e. certain characters are used more frequently than others. This fact can be exploited.
  • 30. • In English ‘e’ is the most common letter followed by ‘t’, ‘r’, ‘n’, ’o’, ‘a’ etc. Letters like ‘q’, ‘x’, ‘j’ are less frequently used. • digrams like ‘th’ and trigrams like ‘the’ are also more frequent.
  • 31. • Tables of frequency of these letters exist. These can be used to guess the plaintext if the plaintext is in uncompressed English language. • The most common two letter combinations are called as digrams. e.g. th, in, er, re and an. The most common three letter  combinations are called as trigrams. e.g. the, ing, and, and ion
  • 32. 3. Playfair Cipher • Best known multiple letter encryption cipher is playfair • In this technique multiple (2) letters are encrypted at a time. • This technique uses a 5 X 5 matrix which is also called key matrix. Constructed using a keyword. Example:
  • 33. • Matrix is filled from L to R. • 1st key word filled without repetition of letters, followed by remaining letters. • 5X5=25 • English letters 26
  • 34. The plaintext is encrypted two letters at a time according to the following rules: 1. Break the plaintext into pairs of two consecutive letters. If a pair is a repeated letter, insert a filler like ‘X‘ in the plaintext, Eg:"Balloon" is treated as "ba lx lo on". 2. If both letters fall in the same row of the key matrix, replace each with the letter to its right (wrapping back to start from end), eg. “AR" encrypts as "RM".
  • 35. 2. If both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg. “MU" encrypts to "CM". 3. Otherwise each letter is replaced by the one in its row in the column of the other letter of the pair, eg. “HS" encrypts to "BP", and “EA" to "IM" or "JM" (as desired)
  • 36. Example 2: PlainText: "instruments" keyword: monarchy After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz' cipher text : ga tl mz cl rq tx Example: Keyword Hellothere Plain text: Playfair
  • 38. 4. Hill Cipher • This cipher is a polygraphic substitution cipher based on Linear Algebra. • The algorithm uses matrix calculations : matrix multiplication, modulo calculation, and the inverse calculation of matrices. • Every letter (A-Z) is represented by a number moduli 26 , where A = 0, B = 1, C = 2…Z = 25 in order to use 2x2 key matrix. NOTE: The complexity of the algorithm increases with the size of the key matrix.
  • 39. To ENCRYPT the text using hill cipher, we need to perform the following operation E(K, P) = (K * P) mod 26 Where K is the key matrix and P is plain text in vector form. Matrix multiplication of K and P generates the encrypted ciphertext.
  • 40. DECRYPT D(K, C) = (K-1 * C) mod 26 Where K is the key matrix and C is the ciphertext in vector form. Matrix multiplication of inverse of key matrix K and ciphertext C generates the decrypted plain text.
  • 42. Step 1: key text (2x2) is DCDF. Convert this key using a substitution scheme into a 2x2 key matrix. Step 2: Convert plain text into vector form. key matrix is 2x2, the vector must be 2x1 for matrix multiplication. (Suppose the key matrix is 3x3, a vector will be a 3x1 matrix.) plain text is TEXT that is four letters long word; thus we can put in a 2x1 vector and then substitute ENCRYPTION
  • 43. Step 3: Multiply the key matrix with each 2x1 plain text vector, and take the modulo of result (2x1 vectors) by 26. Then concatenate the results
  • 44. we get the encrypted or ciphertext as RGWL.
  • 45. Step 1: Calculate the inverse of the key matrix. Note: Here, Extended Euclidean algorithm is used to get modulo multiplicative inverse of key matrix determinant DECRYPTION
  • 46. • The Euclidean algorithm is a way to find the greatest common divisor of two positive integers. (largest number that divides both of them). • A simple way to find GCD is to factorize both numbers and multiply common prime factors. • Extended Euclidean algorithm also finds integer coefficients x and y such that: ax + by = gcd(a, b)
  • 47. Determinant of a matrix Reference: https://www.studypug.com/algebra-help/the- determinant-of-a-3-x-3-matrix-general-and-shortcut- method
  • 50. Step 2: Now, we multiply the 2x1 blocks of ciphertext and the inverse of the key matrix. The resultant block after concatenation is the plain text that we have encrypted i.e., TEXT.
  • 51. 5.Polyalphabetic Cipher • A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. • Vigenere Cipher is a method of encrypting alphabetic text which uses a simple form of polyalphabetic substitution • The encryption of the original text is done using the Vigenère square or Vigenère table.
  • 52. 1. The table consists of the alphabets written out 26 times in different rows, each alphabet shifted cyclically to the left compared to the previous alphabet, corresponding to the 26 possible Caesar Ciphers. 2. At different points in the encryption process, the cipher uses a different alphabet from one of the rows. 3. The alphabet used at each point depends on a repeating keyword.
  • 54. • To encrypt a message, a key is needed that is as long as the message. Usually, the key is a repeating keyword. • Encryption can be done by looking in the Vigenere Table where ciphertext is the letter key’s row and plaintext’s column or by the following formula: 𝐶i = ( i + i o ) o 26 𝑃 𝐾 𝑚 𝑑 𝑚 𝑚 𝑑 • .
  • 55. • Decryption : The key letter again identifies the row. The position of the cipher text letter in that row determines the column, and the plaintext letter is at the top of that column. • The strength of this cipher is that there are multiple ciphertext letters for each plaintext letter, one for each unique letter of the keyword
  • 56. Vernam Cipher • This system works on binary data (bits) rather than letters. • The technique can be expressed as follows: • The ciphertext is generated by performing the bitwise XOR of the plaintext and the key.
  • 57. Vernam Encryption and Decryption • A=0……Z=25 • ABCD0 1 2 3 • Key=length of plain key • Substitute key values aging following A=0…… Z=25 • Now add plain text to key • Addition number > 25 then subtract that number form 26. • Resultant – convert numbers to alphabets  cypher text • Use cypher text and key. • Subtract key from cypher text • If (Cypher – key) is negative number then add 26 to it • Resultant number substitute with its respective letter values.
  • 58. 6. One-Time Pad • It is a system in which a randomly generated private key is used only once to encrypt a message that is then decrypted by the receiver using a matching one- time pad and key. • The 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.
  • 59. • This scheme is unbreakable. • It produces random output that bears no statistical relationship to the plaintext. • The one-time pad is used where very high security is required. • The one-time pad is the only cryptosystem that exhibits perfect secrecy.
  • 60. • Because the ciphertext contains no information whatsoever about the plaintext, there is simply no • The one-time pad offers complete security but, in practice, hastwo 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. Supplying truly random characters in this volume is a significant task.
  • 61. 2. Another problem is that of key distribution and protection. For every message to be sent, a key of equal length is needed by both sender and receiver. way to break the code.
  • 62. Block Ciphers and the data encryption standard
  • 63. Symmetric Cryptography • Block ciphers process messages into blocks, each of which is then en/decrypted  Like a substitution on very big characters  64-bits or more • Stream ciphers process messages a bit or byte at a time when en/decrypting Many current ciphers are block ciphers  Better analyzed.  Broader range of applications.
  • 65. Block Cipher Principles • Block ciphers look like an extremely large substitution • Would need table of 2 Power 64 entries for a 64-bit block • Arbitrary reversible substitution cipher for a large block size is not practical – 64-bit general substitution block cipher, key size 2 Power 64! • Most symmetric block ciphers are based on a Feistel Cipher Structure • Needed since must be able to decrypt ciphertext to recover messages efficiently
  • 66. • In an ideal block cipher, the relationship between the input blocks and the output block is completely random. But it must be invertible for decryption to work. • Hence, it has to be one-to- one, meaning that each input block is mapped to a unique output block. • The mapping from the input bit blocks to the output bit blocks can also be construed as a mapping from the integers corresponding to the input bit blocks to the integers corresponding to the output bit blocks. • The encryption key for the ideal block cipher is the codebook itself, meaning the table that shows the relationship between the input blocks and the output blocks
  • 67. n=4 16 possible input states
  • 68. Problems with Ideal Block Cipher • If a small block size, such as n = 4, is used, then the system is equivalent to a classical substitution cipher.  Such systems are vulnerable to a statistical analysis of the plaintext.  This weakness is not inherent in the use of a substitution cipher but rather results from the use of a small block size. • If n is sufficiently large and an arbitrary reversible substitution between plaintext and ciphertext is allowed, then the statistical characteristics of the source plaintext are masked to such an extent that this type of cryptanalysis is infeasible.
  • 70. Feistel Cipher • Feistel cipher is a structure based on the Shannon structure. • The Shannon structure shows the implementation of confusion and diffusion alternately. • Confusion fabricates a complex relation between the cipher text and encryption key by implementing a complex substitution algorithm. • .
  • 71. • Whereas, the diffusion fabricates a complex relation between plain text and cipher text by implementing more complex permutation algorithm. • The Shannon structure was successful in achieving a more complex block cipher and thus confusion and diffusion were adopted by the Feistel structure
  • 72. Feistel Cipher Structure • Feistel cipher proposed a structure which implements substitution and permutation alternate ly to obtain cipher text from the pain text and vice- versa. • In the Feistel block cipher, each block has to undergo many rounds where each round has the same function.
  • 73. • Substitution is implemented by replacing the elements of plain text or the set of elements of plain text by the element of cipher text or set of elements of cipher text. • A permutation is implemented by changing the order of elements of the plain text. No element here is replaced by any other element, only the order of elements is changed.
  • 74. The Feistel cipher structure above follows the steps below: 1. Convert plain text into binary using ASCII codes of each character. 2. Divide the data into blocks, processed one at a time. 3. The encryption process takes two inputs, one block of data and a master key.
  • 75. 4. When the block is ready for the encryption process, divide it into two halves of equal length. The left half is denoted by Lo​and the right half is characterized by Ro 5. Data is passed through n rounds of execution, where the n is specified by the design of the algorithm. 6. Each round uses the same encryption function and a different sub key generated from the master key. 7. To generate the left half of the next round, Li+1​ , the current right half, Ri​is assigned to it.
  • 76. 8. To generate the right half of the next round, Ri+1​ , the current right half, Ri​undergoes the following steps: – Ri​and the subkeyi is passed through an encryption function. – The result from above step is XORed with the left half of the current round, Li​ . – The result from step 2 is assigned to the right half of the next round, Ri+1​ . 9. The left and right half of data obtained after n rounds of execution is swapped again before concluding the Feistel cipher.
  • 77. Feistel Decryption Algorithm Feistel Cipher structure does not have a different algorithm for decryption. The encryption and decryption function proposed by Feistel cipher are same with some rules which are as follows: 1. The input to the decryption algorithm is a cipher text block produced by the encryption algorithm. 2. The sequence of subkeys used in encryption are reversed. The key Kn is used in the first round of decryption, key Kn-1 in the second round of decryption and so on, until the last round occurs where key K1 is used.
  • 78. The design features of Feistel cipher considered while implementing any block cipher are as follow: • Block Size The block cipher is considered more secure if the block size is larger. But the larger block size can reduce the execution speed of encryption and decryption. Generally, the block size of a block cipher is of 64-bit. But, the modern-day block cipher such as AES has 128-bit block size. • Key Size The security of block cipher increases with the increasing key size. But the large key size may decrease the speed of encryption and decryption. Earlier the key of 64-bit was considered to adequate. But the modern cipher uses a key of size 128-bit.
  • 79. • Number of rounds The number of rounds also increases the security of the block cipher. More are the number of rounds more complex is the cipher. • Subkey generation function More the subkey generation function is complex, difficult it is for a cryptanalyst to crack it. • Round Function Complex round function enhances the security of the block cipher.
  • 80. Considerations in design of a Feistel Cipher. • Fast Software Encryption/Decryption The block cipher is implemented in a software application to achieve better execution speed. • Easy Analysis The block cipher algorithm should be easy to analyze because it would ease in analyzing the cryptanalytic weakness and develop more strength in the algorithm.
  • 82. The data encryption standard • DES is a symmetric-key block cipher published by the National Institute of Standards and Technology (NIST). • DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure. • The block size is 64-bit. Though, key length is 64- bit, DES has an effective key length of 56 bits, since 8 of the 64 bits of the key are not used by the encryption algorithm • DES uses 16 rounds of the Feistel structure, using a different key for each round
  • 83. Permuted input Bit swaped –peroutput Preoutput passed through inverse of initial permutation to produce 64 bit cyphertext Subkey Ki
  • 86. THE STRENGTH OF DES 1. Use of 56 Bit Keys 2. Nature of DES Algorithm 3. Timing Attacks
  • 88. trength of DES : Nature of DES Algorithm
  • 90. Block cipher design principles Block cipher has a specific number of rounds and keys for generating ciphertext. 1. Number of Rounds –The number of Rounds to be suitable for an algorithm to make it more complex, in DES we have 16 rounds ensuring it to be more secure while in AES we have 10 rounds 2. Design of function F –The core part of the Feistel Block cipher structure is the Round Function. • The complexity of cryptanalysis can be derived from the Round function i.e. the increasing level of complexity for the round function  increase in complexity. • To increase the complexity of the round function, the avalanche effect is also included in the round function, as the change of a single bit in plain text would produce a mischievous output due to the presence of avalanche effect.
  • 91. 3. Key schedule algorithm –In Feistel Block cipher structure, each round would generate a sub-key for increasing the complexity of cryptanalysis. • The Avalanche effect makes it more complex in deriving sub-key. Decryption must be done very carefully to get the actual output as the avalanche effect is present in it.

Editor's Notes

  • #24: http://brianveitch.com/maze-runner/caesar/index.html
  • #26: http://brianveitch.com/maze-runner/caesar/index.html A long time ago, in a galaxy far, far away... It is a dark time for the Rebellion. Although the Death Star has been destroyed, Imperial troops have driven the Rebel forces from their hidden base and pursued them across the galaxy. Evading the dreaded Imperial Starfleet, a group of freedom fighters led by Luke Skywalker has established a new secret base on the remote ice world of Hoth. The evil lord Darth Vader, obsessed with finding young Skywalker, has dispatched thousands of remote probes into the far reaches of space…
  • #28: Plaintext: meet me after the toga party
  • #39: https://www.javatpoint.com/hill-cipher-program-in-java
  • #43: https://www.cybrary.it/blog/0p3n/learn-hill-cipher-3x3-matrix-multiplicative-inverse-example/
  • #46: https://www.geeksforgeeks.org/euclidean-algorithms-basic-and-extended/
  • #55: https://www.javatpoint.com/vigenere-cipher
  • #57: https://www.geeksforgeeks.org/vernam-cipher-in-cryptography/
  • #58: https://www.youtube.com/watch?v=ap9dTNOqk1E&ab_channel=SRCOMPUTEREDUCATION
  • #61: https://www.youtube.com/watch?v=VFMSnDZ7FEI&ab_channel=5MinutesEngineering
  • #77: https://www.geeksforgeeks.org/feistel-cipher/
  • #79: https://binaryterms.com/feistel-block-cipher.html
  • #84: https://www.youtube.com/watch?v=Y61qn_SQl40&ab_channel=Udacity