Mod 2 DES
Mod 2 DES
Security
Unit - 2
•The plaintext is first divided into blocks of size 64bits.If last bock is not having
sufficient number of bits i.e. 64bits,then necessary number of bits is appended to
the plaintext to complete the block size.
•Then process each block by using same key. But if two blocks are identical , then
ciphertext block generated are also same.
Disadvantages.
• If two plaintext blocks are identical, then the ciphertext block
generated are also same, therefore known plaintext attack is
possible.
2.Cipher Block Chaining Mode
• In CBC mode drawback of EBC is overcome.
• A key is used for encryption of all the blocks. Then perform XOR
operation between the first plaintext block and initialization
vector.
Disadvantages
• Typical applications:
o General-purpose stream-oriented transmission;
o authentication
3.Cipher Feedback Mode Encryption
3.Cipher Feedback Mode
Disadvantages of CFB
•The error of transmission get propagates due to changing of
blocks
4.Output Feedback Mode
• Converts block cipher into stream cipher
Disadvantage of OFM
• This encrypted value is XOR with block of plain text . The result is
a
block of ciphertext.
Disadvantages
• Integrity of message is not maintained
• It requires a synchronous counter at sender and receiver
• Reuse of counter value, compromise the security.
Key features of modes of operation
Feistel Cipher
The Feistel block cipher uses the same encryption and decryption
algorithms.
Step 2 –
• The plain text block is divided into two halves.
• The left half of the plain text block will be represented as LE0, and the right
half of the block will be RE0.
• Both halves of the plain text block (LE0 and RE0) will go through numerous
rounds of processing plain text to produce the ciphertext block.
Data encryption standard (DES)
DES Algorithm : Introduction
• Developed in early 1970’s at IBM and submitted to NBS.
• DES is landmark in cryptographic algorithms.
• DES works based on Feistel Cipher Structure.
• DES is symmetric cipher algorithm and use block cipher method for encryption and
decryption.
For Example:
16th bit of S-box takes 1st Position as per below
permutation table.
Data encryption standard (DES)
For Example:
40th bit of input takes 1st Position as per below permutation table.
The output of the final permutation is the 64-bit encrypted block (64-bit cipher text
block).
Data encryption standard (DES)
Data encryption standard (DES)
Decryption :
• Double DES performs the same operations as DES only difference is that double
DES use two keys K1 & K2.
• Again, cipher text C1 is encrypted by using another key K2 & generate final cipher
text C2.
• There is a need for security level in order to safely store and transmit
digital images containing critical information.
• Triple DES encrypts input data three times. The three keys are
referred to as K1, K2 and K3.
Triple DES works with two ways:
Triple DES with 3 Keys
Encryption
• Triple DES performs the same operation as double DES. Triple DES using
three keys K1, K2 & K3 while encrypting plain text.
• Again, this cipher text is encrypted using key K2 which obtain the second
cipher text C2.
• Which is again encrypted using K3 & generate final cipher text C3.
Triple DES encryption using 3 keys
Triple DES with 3 Keys
Decryption
• Then C1 cipher text decrypt with K1 key and get original plain
text P.
Triple DES decryption using 3 keys
Triple DES with 2 Keys
Encryption
• Triple DES performs the same operation as double DES.
• Triple DES using two keys K1 & K2 while encrypting plain text.
• First it performs encryption on plaintext P, which is
encrypted using K1 obtains first cipher text C1.
• Again, this cipher text is encrypted using key K2 which
obtain the second cipher text C2.
• Which is again encrypted using K1 & generate final cipher
text C3.
Triple DES encryption using 2 keys
Triple DES with 2 Keys
Decryption
• Decryption of Triple DES is reverse of encryption.
• In triple DES decryption process final cipher
text C3 decrypt using K1, result is cipher text C2.
• C2 will be decrypt with K2 and get C1 cipher text.
• Then C1 cipher text decrypt with K1 key and get
original plain text P.
Triple DES decryption using 2 keys
Triple DES
Advantages
• The image can only be viewed by the receiver as the image is encrypted using
Triple DES and the key is only known to the sender and receiver.
• Since the image is encrypted using Triple DES, it is more secure than DES.
• Since the key is entered by the sender and receiver and is not stored in the
database, it makes the encryption and decryption more secure.
Disadvantages
• The file size to be transmitted becomes large since it contains encrypted data.
• Since the file size is huge it can be suspected to contain some critical information.
Types of Cryptography
These are broadly classified into two types,
• The RSA algorithm generates two unique keys for encryption and decryption,
making it an asymmetric cryptographic algorithm.
• The fundamental operations in RSA are encryption and decryption, based on a pair
of keys: a public key and a private key.
RSA Algorithm
RSA Key Generation
1. Selection of Prime Numbers (p and q):
• φ(n) represents the count of numbers less than n that are coprime to n.
• In the context of RSA, it ensures that the chosen e (part of the public key) and
d (part of the private key) function correctly for the encryption and decryption
processes.
RSA Key Generation
• e is chosen as a substantially prime integer to n and falls within the 1 < e < φ(n)
• Additionally, e must be coprime to φ(n), which means e and φ(n) should have no
common factors other than 1.
• Commonly, values like 3, 5, or 65537 are used as e due to their properties that
make computations efficient.
RSA Algorithm
RSA Algorithm
RSA Algorithm
RSA Algorithm
RSA Algorithm
RSA Algorithm