Ch3
Ch3
Terminologies
• Plain Text
• Cipher Text
• Cryptology
• Cryptography
• Cryptanalysis
• Encryption
• Decryption
Cryptography is the
science of secret writing
with the intention of
keeping the data secret.
Cryptanalysis is the
science or sometimes the
art of breaking
cryptosystems.
Both terms are a subset of
Cryptology.
Basic Terms-Cryptography
• Plain Text − The original message that the person wants to connect with
the other is represented as Plain Text. In cryptography the actual
message that has to be send to the other end is provided as a specific
name as Plain Text.
• Step 2: Then, to obtain the cipher text the text is read as a sequence of
rows.
Columnar Transposition Technique
• The steps to obtain cipher text using this technique are as follow:
• Step 1: The plain text is written in the rectangular matrix of the
initially defined size in a row by row pattern.
• Step 2: To obtain the cipher text read the text written in a rectangular
matrix column by column. But you have to permute the order of
column before reading it column by column. The obtained message is
the cipher text message.
Data Encryption Standard
• Step 1:Discarding every 8th bit of the key produces 56 bit key from
original 64 bit key:
• Before DES process starts ,every eighth bit of 64 bit key is discarded to
produce 56 bit key,i.e. bit positions,8,16,24,32,40,48,56 and 64 are
discarded
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64
Steps in DES
• DES is based on two attributes in cryptography: substitution and
transposition.
• DES consists of 16 steps, each of which is called as round.
• Each round performs the steps of substitution and transposition.
1. In the first step, the 64 bit plaintext block is handed over to an
Initial permutation(IP) function
2. The initial permutation is performed on plaintext
3. Next, Initial permutation produces two halves of permuted blocks,
Left Plaintext(LPT) and Right Plaintext(RPT)
4. Each of LPT and RPT goes through 16 rounds of encryption process,
each with its own key
Steps in DES
5.In the end, LPT and RPT are rejoined ,and a final permutation is
performed on the combined block
6.The result of this process produces 64 bit cipher text
Initial Permutation
• Initial permutation happens only once and it happens before the first
round
• Jugglery of bit positions of the original plain text block
Rounds
• Step 1:Key transformation
• For each round, from a 56 bit key, a different 48 bit sub-key is
generated, is called as key transformation
• For this,56 bit key is divided into two halves, each of 28 bits.
• These halves are circularly shifted left by one or two positions
depending on the round
Round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
No of 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1
key bits
shifted
• After the shift,48 of 56 bits are selected by randomly discarding 8 bits
• Because of this technique ,a different key is used in each DES round.
That makes DES not so easy to crack
Step 2:Expansion Permutation
• After initial permutation, resulting 64 bit permuted text block is
divided into two halves, Left Plain Text(LPT) and Right Plain Text(RPT)
• During expansion permutation.RPT is expanded from 32 bits to 48
bits.
• The 32 bit RPT is divided into 8 blocks with each block consisting of 4
bits
• Next,4 bit block of the above step is then expanded to corresponding
6 bit block. Per 4 bit block,2 bits are added.
• Two bits are the repeated first and fourth bits of 4 bit block
• Now the 48 bit key is XORed with the 48 bit RPT and the resulting
output is given to next step that is S-box substitution
Step 3 S-box Substitution
S-Box substitution is a process that accepts the 48 bit input from the XOR
operation involving the compressed key and expanded RPT and produces a 32 bit
output using substitution technique
Selecting an entry in S box based on the
6 bit input
• Assume the 6 bits of S box is indicated by b1,b2,b3,b4,b5 and b6
• Bits b1 and b6 are combined to form a two bit number(00 to 11),this
specifies row number
• The remaining four bits b2,b3,b4,b5 make up a 4 bit number, this
specifies column number(0000 to 1111)
• Thus the 6 bit input automatically selects the row number and column
number for selection of output
Example:In S-box 2,7 to 12 bits are
101101
Step 5:P-Box permutation
• The outputs of all S-boxes are then combined to form a 32 bit block
which is given to next stage of round P-Box permutation
• These 32 bits are permuted using P –Box
• This mechanism involves simple permutation i.e. replacement of
each bit with another bit as specified in table below:
• E.g.a 16 in first block indicates that bit at position 16 of original input
moves to position 1 in output
Step 6:XOR and Swap
• LPT of initial 64 bit plaintext is XORed with the output produced by P –Box
permutation
• The result is a new RPT.old RPT becomes new LPT in process of swapping
Step 7:Final Permutation
• At the end of 16 rounds, final permutation is performed which is
simple transposition
• The output of final permutation is the 64 bit encrypted block
Asymmetric Key Cryptography
• Asymmetric encryption, also known as public-key cryptography, is a
type of encryption that uses a pair of keys to encrypt and decrypt
data.
• The pair of keys includes a public key, which can be shared with
anyone, and a private key, which is kept secret by the owner.
• In asymmetric encryption, the sender uses the recipient’s public key
to encrypt the data. The recipient then uses their private key to
decrypt the data.
• This approach allows for secure communication between two parties
without the need for both parties to have the same secret key.
• Asymmetric encryption is commonly used in various applications,
including secure online communication, digital signatures, and secure
data transfer.
• Examples of asymmetric encryption algorithms include RSA, Diffie-
Hellman, and Elliptic Curve Cryptography (ECC).
Digital Signature