Mod 2 Notes Crypto

Download as pdf or txt
Download as pdf or txt
You are on page 1of 66

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

VII SEM A & B SECTION

CRYPTOGRAPHY
17EC744
CBCS SCHEME

…………. xxxx …………..

Dr. RAVISHANKAR .C.V.


Professor & HOD-ECE , SaIT.
Mobile : 9986155861
Email : echodsait@gmail.com
Syllabus & Scheme
MODULE - 1
 Basic Concepts of Number Theory and Finite Fields: Divisibility and the
divisibility algorithm, Euclidean algorithm, Modular arithmetic, Groups,
Rings and
Fields, Finite fields of the form GF(p), Polynomial arithmetic, Finite fields of
the form GF(2n)(Text 1: Chapter 3).

MODULE - 2
 Classical Encryption Techniques: Symmetric cipher model, Substitution
techniques, Transposition techniques, Stegnography (Text 1: Chapter 1)
SYMMETRIC CIPHERS: Traditional Block Cipher structure, Data Encryption
Standard (DES) (Text 1: Chapter 2: Section1, 2)

MODULE - 3
 SYMMETRIC CIPHERS: The AES Cipher. (Text 1: Chapter 4: Section 2, 3, 4)
Pseudo-Random-Sequence Generators and Stream Ciphers: Linear
Congruential Generators, Linear Feedback Shift Registers, Design and
analysis of stream ciphers, Stream ciphers using LFSRs (Text 2: Chapter 16:
Section 1, 2, 3, 4)
MODULE – 4
More number theory: Prime Numbers, Fermat‘s and Euler‘s theorem,
Primality testing, Chinese Remainder theorem, discrete logarithm.
(Text 1: Chapter 7)
Principles of Public-Key Cryptosystems: The RSA algorithm, Diffie -
Hellman Key Exchange, Elliptic Curve Arithmetic, Elliptic Curve
Cryptography (Text 1: Chapter 8, Chapter 9: Section 1, 3, 4)

MODULE – 5

One-Way Hash Functions: Background, Snefru, N-Hash, MD4, MD5,


Secure Hash Algorithm [SHA],One way hash functions using
symmetric block algorithms, Using public key algorithms, Choosing
a one-way hash functions, Message Authentication Codes.
Digital Signature Algorithm, Discrete Logarithm Signature Scheme
(Text 2:
Chapter 18: Section 18.1 to 18.5, 18.7, 18.11 to 18.14 and Chapter 20:
Section 20.1, 20.4)
MODULE – 2
Classical Encryption Techniques: Symmetric cipher model, Substitution
techniques, Transposition techniques, Stegnography (Text 1: Chapter 1)
SYMMETRIC CIPHERS: Traditional Block Cipher structure, Data Encryption
Standard (DES) (Text 1: Chapter 2: Section1, 2)

 The purpose of cryptography is to protect data transmitted in


the likely presence of an adversary. a cryptographic
transformation of data is a procedure by which plaintext data is
disguised, or encrypted, resulting in an altered text,
called ciphertext, that does not reveal the original input. The
ciphertext can be reverse-transformed by a designated
recipient so that the original plaintext can be recovered.
Cryptography plays an essential role in
 Authentication. This process to prove the identity of an entity
can be based on something you know, such as a
password; something you have, such as an encryption key or
card; something you are, such as biometric measurements,
including retinal scans or voice recognition; or any
combination of these.
Data confidentiality. With this property, information is not made
available or disclosed to unauthorized individuals, entities, or
processes. When two or more parties are involved in a
communication, the purpose of confidentiality is to guarantee that
only those parties can understand the data exchanged.
Confidentiality is enforced by encryption.

Data integrity. This property refers to data that has not been
changed, destroyed, or lost in an unauthorized or accidental
manner. The need for data integrity is especially evident if data is
transmitted across a nonsecure network, such as the Internet, where
a man-in-the-middle attack can easily be mounted. Integrity is
enforced by mathematical functions applied to the message being
transmitted.

Nonrepudiation. Repudiation is the denial by one of the entities


involved in a communication of having participated in all or part of
the communication.
 Before going towards the concepts, we must
understand the basic terminologies ;
 Plain Text : Original Message or information.
 Cipher Text : Coded Message or information.
 Encryption/Enciphering/Coding : Process of
converting PT to CT. Also called as Encoding.
 Decryption/Deciphering : Process of restoring PT
from CT. Also called as Decoding.
 Cryptography : Different schemes used for encryption
 Crypto analysis : Techniques used to decode the
message.
 There exist Two Types or methods in Encryption
techniques : Symmetric & Asymmetric type.
Secret Key Cryptography (SKC): Uses a single key for both encryption and
decryption; also called symmetric encryption. Primarily used for privacy and
confidentiality.
Public Key Cryptography (PKC): Uses one key for encryption and another for
decryption; also called asymmetric encryption. Primarily used for authentication, non-
repudiation, and key exchange.
Hash Functions: Uses a mathematical transformation to irreversibly "encrypt"
information, providing a digital fingerprint. Primarily used for message integrity.
 In security Literature Symmetric & Asymmetric are used
instead of Secret & Public .
 Cryptography in Greek means CRYPTO ( Hidden/ Secret)
and Graphy (Writing).
 It is the art of secret writing, The basic service provided by
Cryptography is the ability to send information between
people in a way that prevents others from reading it.
 The cryptography is based on representing information as
numbers and mathematically manipulate those numbers and
also it performs integrity checking, Authentication.
 Cryptographic systems consists of algorithm and secret value
called KEY.
 https://youtu.be/3ABeQHuglCM
 The Model of Cryptographic symmetrical encryption
process is as below;
SYMMETRIC TECHNIQUE
1. SUBSTITUTION 2. BLOCK CIPHER
- MONO ALPHABETIC - FEISTAL
- POLY ALPHABETIC - FAISTAL DECRIPTION
- CAESAR CIPHER ALGORITHM
- PLAY FAIR
- HILL CIPHER 3. STREAM CIPHER
- ONE TIME PAD - VIGENIRE
4.TRANSPOSITION - VERNAM
- RAIL FENSE - RC4
5. ROTOR MACHINES - RC5
6. DES
- DOUBLE DES 7. AES
- TRIPPLE DES
* WITH 2 KEY 8. BLOW FISH
* WITH 3 KEY
SUBSTITUTION TECHNIQUE
 It offers basic approaches to symmetric encryptions. It is a
technique in which the letters of Plain Text are replaced by
other Letters or numbers or symbols.
 Normally Plain Text are LOWER CASE
 Cipher Text are UPPER CASE
 1. CAESAR CIPHER :
This involves replacing each letter of the alphabet with the
letter standing three places further down the alphabet.
For example,
plain: meet me after the toga party
cipher: PHHW PH DIWHU WKH WRJD SDUWB
 MONO ALPHABETIC CIPHER :
 PLAYFAIR CIPHER :
It is a best multiple letter encryption cipher. It is invented by British Scientist Sir.Charles
Wheatstone in 1854, name is because of his friend Baron Playfair of St.Andrews. It treats
diagrams in the plain text as single units and translates there units into cipher text
diagrams.
It is based on use of 5X5 matrix of letters constructed using a key word.

M O N A R

C H Y B D

E F G I/J K

L P Q S T

U V W X Z
 Here, The matrix is filled by letter of Keyword from left to right
and from top to bottom.
 Remainder of matrix is filled with alphabets randomly but in
alphabetic order.
 I & J letters count as one letter.
 Repeating plain text letters that would fall in same pair are
separated with a filler letter. Ex : ‘x’ in Balloon, Cool, School, etc..
 Here 26x26 = 676 diagrams so identification of individual
diagrams is more difficult.
 The relative frequency of individual letters has more range than
that of diagrams making frequency analysis is much more
difficult.
 It was used in WW-I & WW-II by British Army & USA.
 It is relatively easy to break. Because it still leaves much of the
structure of plain text language.
 Note : In any given Book of a given page, Total number of
occurrence of each letter in text divided by number of occurrence
of letter ‘e’ ( most frequently used letter)
 For example : using the Playfair cipher diagram, write the cipher
diagram /table for the given PT :-
 ENGLISH
 ENGINEERING
 ELECTRONICS
 TECHNOLOGY
 SAMBHRAM
 CRYPTOGRAPHY

 HILL CIPHER :
 It is developed by Lester Hill in 1929. This encryption algorithm takes
‘m’ successive Plain Text letters & substitutes for them ‘m’ cipher text
letters.
 Here, each cipher text is a numerical value a=0,b=1,……z=25).
 Here mathematical representation & calculation is in such a way that,
the encryption key is a 3X3 matrix ―› ( K )
 Decryption key is a 3 X 3 matrix ―› ( K-1 )
 Wherein K. K-1 = K-1. K = I = Identity matrix ,which is square matrix.
a b c d e f g h i j k l mn o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5

 Let for m=3 , Letter is ‘C’. Then,


 C1=(K11P1+K12P2+K13P3)mod26
 C2 = ( K21P1+K22P2+K23P3 )mod 26
 C3= (K31P1+K32P2+K33P3 ) mod 26.
That means, C=K.P mod26

C1 K11 K12 K13 P1


C2 = K21 K22 K23 P2 Mod 26
C3 K31 K32 K33 P3

Here, Cipher text C = KP mod26.


Plain text P = CK-1 mod26.
 Let us consider an Example: The Plain Text given is
 “ pay more money”, and the encryption key K as;

 Now to get the cipher text, we have to write the equation


C=PK.mod26, to get P, in the plain text given arrange the word in
such a way that three Letters as one set, then the arrangement is
as below;
pay mor emo ney
Then the equivalent numbers for alphabet s pay is ( 15 0 24 ) ,
mor is ( 12 14 17 ), emo is ( 4 12 14 ) , ney is ( 13 4 24 ).

Then simplifying the equation for each 3 letter combination with key
matrix :
 For ‘pay ’

 (15 0 24 )K = ( 303 303 531 ).mod 26 = ( 17 17 11 )


= RRL
 Similarly after doing the same procedure for other letter combination , total
wordings we will get ;

 RRLMWBKASPDH which is the Cipher text for the plain text


‘ pay more money ’
 For decryption, again arrange the Cipher text word in the three letter format, then
apply the decryption equation P = CK-1 mod 26. and get the plain text.
 Problems :
Using the Hill Ciphering technique find the cipher text for the given plain text , Use the Key
K with the same elements as in the above example.
 electronics
 communication
 technology
 engineering
NOTE : While making the letter /alphabet combination of 3 alphabet each, at the end if
only one alphabet shortage then assume ‘a’ , if two alphabet shortage then assume ‘b’
or any random alphabet, which is known only by you.
 VERNAM CIPHER :
POLY ALPHABETIC CIPHER / VIGENERE CIPHER :
 Here different mono alphabetic substitution is implemented.
Here, a set of related mono alphabetic substitution rules is
used.
 A key determines which particular rule is chosen for a given
transformation.
 General algorithm used here is “ vigenere Cipher”.
 Here, set of related mono alphabetic substitution rules
consists of 26 Caesar ciphers with shifts of 0 – 25.
 Each cipher is denoted by a key letter which is the cipher text
letter that substitutes for plaintext letter “a”.
 Therefore, a Caesar cipher with shift of 3 is denoted by a key
value ”d”.
 To get cipher text and again plain text by decryption, we
require Vigenere table, the general structure of the table is as
below;
a b c d e f g h i j k l mn o p q r s t u v w x y z
a 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
b 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 A
c C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
d D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
e E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
f F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
g G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
h H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
i I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
j J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
k K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
l L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
m M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
n N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
o O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
p P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
The procedure for encryption for the plain text is ;
Let key Letter = X
Plain Text Letter = Y
Then Cipher text from the table is = V
Here , the key length is equal to the plain text length but the key is
repeating key word.
For example : if we select a key word as “ help ” and the Plain text as
“ Communication “ then the key and plain text structure is;
PT
c o m m u n i c a t i o n
KEY h e l p h e l p h e l p h
CT J S U B H R T R H X T D U

Then, for each PT refer the respective letter at column, then refer
the key letter at respective row…the junction of both PT & Key is
the letter as CT., here for “ch” the CT is “ J ”.
 PROBLEMS:
 Using the Vigenere Ciphering method, find the Cipher Text
for the given Plain Text by taking Key K as “ karnataka ”.
 electronics and Communication
 technological university
 government of karnataka
 cryptography and security
 royal challengers bangalore
TRANSPOSITION TECHNIQUE :
 Here we perform permutation on Plain Text Letters.
 Here, three methods are used :-
 1. Common method used is – RAIL FENCE TECHNIQUE.
 Here,the plain text is written down as a sequence of diagonals and then read
off as a sequence of rows/.
 For example : Plain Text is – Sambhram Institute of Technology , Then by
this method;

s m h a i
a b r m n

s i u e f
t t t o t

e h O o y
c n l g
 Then considering the complete first row characters and then second row
characters and writing in a single line will become CT for the given PT.
 CT = SMHAISIUEFEHLGABRMNTTTOTCNOY
 2. Second Method :

3. Third Method :
STEGNOGRAPHY :
Steganography is the practice of concealing a file, message, image, or video within another
file, message, image, or video. The word steganography comes from Greek steganographia,
which combines the words steganós, meaning "covered or concealed", and -graphia
meaning "writing".
The oldest documented case of steganography dates to 500 BC, in which Histiaeus, the
ruler of Milteus, tattooed a message on the shaved head of one of his slaves and let the hair
grow back. He then sent the slave to the Aristagoras, his son-in-law, who shaved the slave’s
head again and revealed the message.
Steganography, the practice of hiding information, has been around for centuries. And in
parallel to technological advances, steganography has also evolved and adapted with the
advent of computers and the internet.
Digital steganography usually involves hiding data inside innocuous files such as images,
videos, and audio.
Today, digital steganography is one of the important components in the toolboxes of spies
and malicious hackers, as well as human rights activists and political dissidents.
Steganography works by hiding information in a way that doesn’t arouse suspicion. One of
the most popular techniques is 'least significant bit (LSB) steganography. In this type of
steganography, the information hider embeds the secret information in the least significant
bits of a media file.
For instance, in an image file each pixel is comprised of three bytes of data corresponding
to the colors red, green, and blue (some image formats allocate an additional fourth byte to
transparency, or ‘alpha’).
LSB steganography changes the last bit of each of those bytes to hide one bit of data. So, to
hide one megabyte of data using this method, you’ll need an eight-megabyte image file.
Since modifying the last bit of the pixel value doesn’t result in a visually perceptible change
to the picture, a person viewing the original and the steganographically modified images
won’t be able to tell the difference.
The same scheme can be applied to other digital media (audio and video), where data is
hidden in parts of the file that result in the least change to the audible or visual output.
Another less popular steganography technique is the use of word or letter substitution.
Here, the sender of the secret message hides the text by distributing it inside a much larger
text, placing the words at specific intervals.
While this substitution method is easy to use, it may also make the text look strange and
out of place, since the secret words might not fit particularly well into their target
sentences.

There are other types of steganography, such as hiding an entire partition on a hard drive,
or embedding data in the header section of files and network packets. The effectiveness of
these methods depends on how much data they can hide and how easy they are to detect.

Malicious hackers use steganography for a variety of tasks such as hiding malicious
payloads and script files. Malware developers often use LSB steganography to hide the code
for their malware in images of celebrities and famous songs and execute them with another
program after the file is downloaded on the victim’s computer.

“The term ‘Trojan Horse’ is used to describe a dangerous file hidden within a harmless file.
Macro attacks are a form of steganography as well,” Trustwave’s Winkler says.
“Steganography will be used by creative hackers whenever there is a need to bypass
protections.”

Cybercriminals, however, are not the only actors who use steganography on a daily basis.
Spies use the technique to communicate with their command center without arousing
suspicion among their hosts.

Tech-savvy human rights activists and dissidents also use steganography when they want to
send sensitive information.
Differences between steganography and cryptography
Steganography is often compared to cryptography. While steganography hides
information, cryptography focuses on rendering the data unreadable to everyone
except its intended recipient. Once a stream of data is encrypted, only a person
who has access to its decryption key will be able to unlock it.
But if cryptography provides better protection for secret data, why use
steganography at all?
The presence of cryptography reveals that something is hidden, and in many
cases, this is enough to get the sender in trouble.
“In a highly monitored country, like say China or Iran or North Korea,
cryptographic files can be detected and the very fact you are sending/receiving
them could raise suspicion,” says security researcher John Ortiz.
“When they show up and put a gun to your head for the key, even the most secure
crypto is worthless.”

Sometimes, steganography and cryptography are used together.

“Steganography and encryption are not actually mutually exclusive,” says Jerome
Segura, director of threat intelligence at Malwarebytes. “The former is mainly a
way to conceal data within an image file, but that data doesn’t have to be in clear
text either.”
Recent examples of steganography :

Detecting steganography can be very tricky, but recent examples of steganography detected
in malicious attacks include:
January 2020: Researchers at Malwarebytes reported credit card skimmer code hidden in
image files in compromised e-commerce websites.
January 2020: Researchers at Guardicore Labs discovered a cryptominer that was hidden
inside WAV audio files.
August 2019: Researchers at TrendMicro find a new variant of keylogger and
cryptocurrency stealer malware LokiBot which uses steganography to hide its malicious
code inside a jpeg file.
April 2019: a former GE engineer was charged with economic espionage. The employee had
encrypted files containing GE’s proprietary information and hidden them in a photo of a
sunset.
February 2019: researchers at ad fraud prevention firm Devcon discovered a malvertising
campaign using steganography to hide malicious JavaScript code.
December 2018: Malicious actors used steganography to hide malicious code in Twitter
memes.
Block ciphers & DES
 A block cipher is an encryption/decryption scheme in which
a block of plaintext is treated as a whole and used to
produce a cipher text block of equal length.
 A block cipher encrypts a block of PT into CT of equal
length. That means it operates on PT block of ‘n’bits to
produce a CT block of ‘n’ bits.
 Block ciphers divide a plaintext into identically sized
blocks. Generally, the blocks are of length greater than or
equal to 64 bits. The same transformations are applied to
each block to perform the encryption.
 All the widely known secret-key block-cipher algorithms
exhibit the cryptographic properties desired in a block
cipher. Foremost of these is the fact that each bit of the
cipher text should depend on all key bits.
 Changing any key bit should result in a 50 percent chance of
changing any resulting cipher text bit. Furthermore, no statistical
relationships should be inferable between a plaintext and its
corresponding cipher text. In the reminder of this section, we
present the most common secret-key block-cipher algorithms.
 Generally a block of 64 or 128 bits is used. There are 2n possible
different PT blocks for encryption & decryption.
 For an ‘n’ bit general substitution block cipher ,the size of the
key is n X 2n.
 For example : For 64 bit block, the key size is 64 X 264 ≈ 270
≈ 1021 bits.
 Feistel proposed a cipher concept that- we can approximate
simple substitution cipher by the concept of product cipher. i.e.
performing of 2 or more basic ciphers in sequence such that the
final result or product is cryptographically stronger.
 Claude Shannon during 1945 , proposed a product cipher
proposes CONFUSION & DIFFUSION functions.
 This idea is to thwart crypto analysis based on statistical
analysis, where;
 In Diffusion, The statistical structure of PT is dissipated into
long range statistics of cipher text. That means each CT digit
is affected by many PT digits.
 For example: A message M is diffused to encrypt as below;
M = m1,m2,m3,……….with averaging function,
yn = ∑ki=1 mn+i ( mod 26)

Here, we add ‘k’ successive letters to get CT yn .


In Confusion, It makes the statistical relationship between PT &
CT as complex as possible by considering value of encryption key
as complex as possible 7 is achieved by the use of complex
substitution algorithm.
Block Cipher Stream Cipher

It process PT in relatively large It process PT in blocks as


blocks ( n≥ 64 bits). smaller 1 bit.

Same is used to encrypt Encryption also as above


successive blocks hence therefore memory advantage.
memory used is very less.
 Symmetric ciphers is useful , because it offers confidentiality,
Block cipher not security for all applications, but offers high
security, suffers from speed & memory limitations ( Code
Size , Data Size , Cache Memory ).
 Constraints on h/w, s/w. chip cards, differences of tolerance
of applications to properties of various mode of operation,
but efficiency is less.
Basic block diagram represenation
of block cipher

 The Block ciphers are based on Feistel structure which


is actually based on the property of Confusion &
diffusion.
 The Feistel structure , Feistel Encryption ,Feistel
Decryption and Feistel Function is as below;
Feistal structure
The input block to each round is divided into two halves that can be denoted as L
and R for the left half and the right half.
In each round, the right half of the block, R, goes through unchanged. But the left
half, L, goes through an operation that depends on R and the encryption key. First,
we apply an encrypting function ‘f’ that takes two input − the key K and R. The
function produces the output f(R,K). Then, we XOR the output of the
mathematical function with L.
In real implementation of the Feistel Cipher, such as DES, instead of using the
whole encryption key during each round, a round-dependent key (a sub key) is
derived from the encryption key. This means that each round uses a different key,
although all these sub keys are related to the original key.
The permutation step at the end of each round swaps the modified L and
unmodified R. Therefore, the L for the next round would be R of the current
round. And R for the next round be the output L of the current round.
Above substitution and permutation steps form a ‘round’. The number of rounds
are specified by the algorithm design.
Once the last round is completed then the two sub blocks, ‘R’ and ‘L’ are
concatenated in this order to form the cipher text block.
Feistal encryption & decryption process
Feistal process of data encryption
Feistal function
DES [ Data Encryption Standard ]
One of the most widely recognized secret-key block ciphers is the Data
Encryption Standard (DES) algorithm. DES was developed
by IBM cryptographers in the early 1970s and was adopted as a U.S.
government standard in 1976. DES is intended for the protection of sensitive
but unclassified electronic information. Because it uses the same key for
both encryption and decryption, the algorithm is referred to as a symmetric
cipher.
DES is a block cipher in which a 64-bit input plaintext block is transformed
into a corresponding 64-bit cipher text output. DES uses a 56-bit key
expressed as a 64-bit quantity in which the least relevant bit in each of the 8
bytes is used for parity checking. DES is a Feistel algorithm that iterates over
the data 16 times, using a combination of permutation and substitution
transformations along with standard arithmetic and logical operations, such
as XOR, based on the key value.
For many years, the DES algorithm withstood attacks. Recently, as the result
of increased speed of computing systems, DES has succumbed to brute-
force attack on several occasions, demonstrating its vulnerability to
exhaustive searching of the key space.
 Digital Encryption Standard was developed by IBM and NSA (
National Security Agency_) of USA in 50`s forms the basis not
only for UNIX password program but also for ATM pin
authentication.
 It uses only 56 bits thus it is now susceptible to BRUTE FORCE
ATTACK ( i.e. to try every possible key and see which decrypts
the message).
 In the late 1960s, IBM set up a research project in computer
cryptography led by Horst Feistel. The project concluded in 1971
with the development of an algorithm with the designation
LUCIFER.
 In 1973, the National Bureau of Standards (NBS) issued a request
for proposals for a national cipher standard. IBM submitted the
results of its Tuchman–Meyer project. This was by far the best
algorithm proposed and was adopted in 1977 as the Data
Encryption Standard.
DES works by encrypting groups of 64 message bits, which
is the same as 16 hexadecimal numbers. To do the
encryption, DES uses "keys" where are also apparently 16
hexadecimal numbers long, or apparently 64 bits long.
However, every 8th key bit is ignored in the DES algorithm,
so that the effective key size is 56 bits. But, in any case, 64
bits (16 hexadecimal digits) is the round number upon
which DES is organized.

For example, if we take the plaintext message


"8787878787878787", and encrypt it with the DES key
"0E329232EA6D0D73", we end up with the cipher text
"0000000000000000". If the cipher text is decrypted with
the same secret DES key "0E329232EA6D0D73", the result
is the original plaintext "8787878787878787".
Example: Let M be the plain text message M = 0123456789ABCDEF,
where M is in hexadecimal (base 16) format. Rewriting M in binary
format, we get the 64-bit block of text:

M = 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010
1011 1100 1101 1110 1111
L = 0000 0001 0010 0011 0100 0101 0110 0111
R = 1000 1001 1010 1011 1100 1101 1110 1111

The first bit of M is "0". The last bit is "1". We read from left to right.
DES operates on the 64-bit blocks using key sizes of 56- bits. The keys
are actually stored as being 64 bits long, but every 8th bit in the key
is not used (i.e. bits numbered 8, 16, 24, 32, 40, 48, 56, and 64).

However, we will nevertheless number the bits from 1 to 64, going


left to right, in the following calculations. But, as you will see, the
eight bits just mentioned get eliminated when we create sub keys.
 The main DES encryption algorithm is very big and is in expanded
version not possible to show the structure, so Simplified DES
( S-DES ) version is used to explain the concept of DES.
 Here instead of 16 rounds, one round explanation is given.
 It is developed by Prof. Edward Schafer of Santa Clara university. Below
fig. Shows the overall structure of SDES ;
Points should be remembered :
It is a block cipher. It has 8-bits block size of plain text or cipher text.
It uses 10-bits key size for encryption. It is a symmetric cipher. It has Two Rounds.
Here, The algorithm takes 8 bit PT and 10 Bit Key as input and produces 8 bit
block of CT as output. It performs 5 functions namely IP ( initial permutation), f k
( Complex function to perform Permutation & substitution w.r.t. key), Sw ( Switch
function to make two halves of data), fk function, IP-1 ( Inverse initial
Permutation function).
Here the Encryption algorithm is given by :

IP-1 . Fk2 . SW . Fk1 . IP

Or CT = IP-1 ( FK2 ( FK1 (IP ( PT ) )

Here K1 = P8 ( Shift ( P10 ( key ) ) )


Similarly, the decryption is same as encryption. Then,

PT = IP-1 ( FK1 ( SW (FK2 ( IP ( CT ) ) ) ) )


KEY GENERATION
 Here, 10 bit key is shared between Sender & Receiver, From this
Two 8 bit Sub keys produced for use in Encryption & decryption.
 Let key ( 1010000010 ) permuted to ( 10000 01100 ) then left
shift 1 bit separately 5 bit each then it is 00001 11000
 Then P8 operation on above is left shift of 2
 That is; 000001 11000 becomes 00100 00011.
 Then P8 applied K2 is generated as ( 01000011 ).

 The DES algorithm analysis and design based on Three critical


aspects they are;
 NO. OF ROUNDS
 DESIGN OF FUNCTION ‘F’
 S – BOX DESIGN
 KEY SCHEDULING
 The Strength of DES :
 Generally the strength of level of security provided by DES is
analyzed by Two areas they are KEY SIZE and NATURE OF
ALGORITHM.
 Use of 56 bit keys
 Nature of DES algorithm
 Timing Attack
 Here, the key length is of 56 bits hence 256 Possible keys that
means 7.2 x 1016 keys even Brute force attack is also impractical.
 Here, the characteristics of DES algorithm depends on Eight
substitution tables or S-Boxes and the iteration used.
 Here, Due to timing attack, information about the key or the PT
is obtained by observing how long it takes a given
implementation to perform decryption on various cipher texts.
It analyses on the fact that an encryption or decryption
algorithm often takes slightly different amounts of time on
different inputs.
Advantages & Disadvantages of DES
 Advantages:
 its a 56 bit key. So there are 2^56 possibilities of keys which would take
a decade to find the correct key using brute-force attack
 Encryption and decryption takes the same algorithm. Only that the
function need to be reversed and the key should be taken in opposite
order. This is very convenient for software and hardware requirements.
 Disadvantages:
 Weak keys : the key that is selected on the rounds are a problem .
During splitting of keys to two half and swapping them might throw up
the same result if they have continuous 1’s and 0’s. This ends up in using
the same key through out the 16-cycles
 There can be same output from the S-Boxes on different inputs on
permutation. These are called Semi weak keys.
 If the message is encrypted with a particular key, and is taken 1’s
compliment of that encryption will be same as that of the encryption of
the compliment message and compliment key.
 The initial and final permutation is not exactly clear and seems
confusing.
Module – 2 : Assignments
 Explain why Cryptography is necessary ?
 Explain three different types of Cryptographic systems.
 Briefly explain the concept of Symmetric and Asymmetric
cryptography.
 With a neat sketch, Explain Simplified symmetric encryption
model.
 With a neat sketch, Explain the model of symmetric crypto
system.
 List Three independent dimensions of Cryptographic systems
and explain.
 Explain different types of attacks on encrypted messages.
 Write an explanatory note on various types of Encryption.
 List out different types of Symmetric encryption techniques,
explain briefly.
 Write a different cryptographic methods used in Substitution
technique?
 Write a note on Caesar Cipher with an example.
 Using Caesar cipher obtain the CT for the PT :-
 1. Engineering 2. Technology 3. Electronics and communication. 4.
Communication engineering.
 Write an explanatory note on Mono alphabetic ciphering method with
suitable example.
 Write a note on Hill ciphering technique with an example.
 With suitable example, Explain the concept of Play fair ciphering method.
 Write an explanatory note with an example, how vernam ciphering
technique converts PT to CT.
 Explain how poly alphabetic cipher is used to convert a given PT to CT.
 Explain with an example, how the transposition technique is used to
convert PT to CT.
 What is stegnography? Explain different methods adopted in
stegnography?
 Explain the difference between Stegnography & Cryptography.
 What are Block ciphers ? Explain the concept of Block cipher.
 Explain the difference between the Block cipher and Stream Cipher.
Write a note on Feistel Structure with suitable diagram.
Write a note on concept of Confusion and Diffusion in Block cipher technique.
Explain with suitable sketch, the concept of Feistel Encryption and Decryption .
Explain in detail the concept and working of Feistel Function.
What is DES , Explain in detail its advantages and disadvantages over other cryptographical
techniques.
What is SDES, Explain in detail the Encryption, Decryption and Key generation with
suitable diagrams.
Explain in detail , the strength of DES.
Perform PT to CT using Caesar cipher, Hill cipher, Play fair cipher, Poly alphabetic, Mono
Alphabetic, Vernam, Transposition technique for PT;
- Given in the earlier PPT slides as problems &
ENGLISH
ENGINEERING
ELECTRONICS
TECHNOLOGY
SAMBHRAM
CRYPTOGRAPHY

Submission Date : 27-10-2020

You might also like