Unit II
Unit II
Triple DES
Triple DES (3DES) is an encryption algorithm that applies the DES cipher three times using either
two or three distinct keys. The two-key version encrypts, decrypts, and then encrypts the data
again, while the three-key version uses three separate keys for encryption and decryption. It
provides stronger security than single DES, with a key size of 112 bits (two-key) or 168 bits (three-
key).
1. Two-Key Triple DES (2-Key 3DES)
Two-Key 3DES uses two keys to apply the Data Encryption Standard (DES) algorithm three times.
In this case, K1 and K2 are used, but K1 is applied for both the first and third encryption stages.
Process:
1. First stage: Encrypt the plaintext PPP using the first key K1.
C1=E(K1,P)
2. Second stage: Decrypt the result from the first stage using the second key K2.
C2=D(K2,C1)
3. Third stage: Encrypt the result from the second stage again using the first key K1.
C=E(K1,C2)
So, the final ciphertext C is generated by applying DES encryption and decryption with two keys
as follows:
Formula:
C=E(K1,D(K2,E(K1,P)))
Where:
• P = Plaintext
• C = Ciphertext
• K1,K2 = Two keys used
• E(K,X) = Encryption of X using key K
• D(K,X) = Decryption of X using key K
Decryption process:
1. First stage: Decrypt the ciphertext CCC using K1.
C2=D(K1,C)
2. Second stage: Encrypt the result from the first stage using K2.
C1=E(K2,C2)
3. Third stage: Decrypt the result from the second stage using K1.
P=D(K1,C1)
So, the decryption formula is:
P=D(K1,E(K2,D(K1,C)))
Security:
• Two-Key 3DES offers a key length of 112 bits (56-bit * 2) due to the use of two keys.
• While it's stronger than single DES (56-bit), it's still vulnerable to certain cryptographic
attacks like the meet-in-the-middle attack.
RSA Algorithm
The Rivest-Shamir-Adleman (RSA) algorithm, introduced in 1978, is one of the most widely
used public-key cryptographic systems. RSA relies on the difficulty of factoring large numbers
and is the most popular encryption technique for secure data transmission.
Key Concepts and Components
1. Plaintext and Ciphertext:
In RSA, the plaintext and ciphertext are represented as integers between 0 and n−1,
where n is a large number typically about 1024 bits in size. The message is encrypted in
blocks, each having a binary value less than n.
2. Public Key and Private Key:
The RSA algorithm uses two keys:
o Public Key (PU): Consists of two values, e (the public exponent) and n (the
modulus), which are used for encryption.
o Private Key (PR): Consists of d (the private exponent) and n, used for decryption.
3. Encryption and Decryption:
o Encryption: The encryption formula is C=Memod n, where MMM is the plaintext
message and Cis the ciphertext.
o Decryption: The decryption formula is M=Cdmod n, where C is the ciphertext,
and M is the original message.
The sender encrypts the message using the receiver's public key, and the receiver decrypts it
using their private key.
Applications of RSA
1. Encryption and Decryption:
RSA is widely used to secure data during transmission, where the public key encrypts the
data and the private key decrypts it.
2. Digital Signatures:
RSA is also used to generate digital signatures, ensuring the authenticity and integrity of
messages. The sender signs the message with their private key, and the receiver verifies
the signature with the sender's public key.
3. Key Exchange:
RSA can be used for secure key exchange, where two parties can securely exchange a
symmetric key for faster encryption after using RSA for initial secure communication.
Computational and Cryptanalytical Considerations
• Efficiency:
RSA is computationally expensive due to the large exponentiations involved in
encryption and decryption. However, its strength lies in the computational difficulty of
factoring large numbers.
• Cryptanalysis:
The primary attack on RSA is factorization. If an attacker can factor n into p and q, they
can compute P(n) and derive the private key d. Therefore, selecting sufficiently large
prime numbers for p and q is essential for maintaining security.