UNIT V CRYPTOGRAPHY
UNIT V CRYPTOGRAPHY
UNIT V CRYPTOGRAPHY
Overview of encryption techniques - symmetric cryptography - Data Key Characteristics:
Encryption Standard (DES) - International Data Encryption Algorithm Single shared key for encryption and decryption.
(IDEA) - RC Ciphers - Public-key algorithm - RSA algorithm - Pretty Good Faster than asymmetric encryption.
Privacy - One-way Hashing Suitable for bulk data encryption.
Key distribution is a challenge.
Overview of Encryption Techniques Common Symmetric Encryption Algorithms:
Encryption is the process of converting plaintext into cipher text to protect 1. DES (Data Encryption Standard):
the confidentiality, integrity, and authenticity of data. It is a fundamental o Key size: 56 bits.
aspect of modern cybersecurity and is used in various applications, including o Block size: 64 bits.
secure communication, data storage, and authentication. Encryption o Now considered insecure due to its short key length.
techniques can be broadly categorized into two types: symmetric o Replaced by 3DES (Triple DES), which applies DES three
encryption and asymmetric encryption. Below is a detailed overview of times with different keys.
these techniques, along with their subtypes, algorithms, and use cases. 2. AES (Advanced Encryption Standard):
o Key sizes: 128, 192, or 256 bits.
o Block size: 128 bits.
o Widely used and considered secure.
o Efficient in both hardware and software implementations.
1. Symmetric Encryption
Symmetric encryption uses the same key for both encryption and decryption.
It is fast and efficient, making it suitable for encrypting large amounts of data.
However, the key must be securely shared between the communicating
parties.
3. Blowfish:
o Key size: 32 to 448 bits.
o Block size: 64 bits.
1
AC3401 Information Coding Techniques Unit V Cryptography
o Fast and secure but largely replaced by AES. o Based on the factorization of large prime numbers.
4. Two fish: o Widely used for secure data transmission and digital
o Key size: 128, 192, or 256 bits. signatures.
o Block size: 128 bits. 2. ECC (Elliptic Curve Cryptography):
o A successor to Blowfish, known for its flexibility and security. o Key sizes: 160 to 521 bits.
5. ChaCha20: o Provides equivalent security to RSA with smaller key sizes.
o Stream cipher. o Efficient in resource-constrained environments (e.g., mobile
o Key size: 256 bits. devices).
o Used in modern protocols like TLS (Transport Layer 3. Diffie-Hellman:
Security). o Used for secure key exchange.
Use Cases: o Does not encrypt data directly but enables secure sharing of
Encrypting files and databases. symmetric keys.
Secure communication (e.g., VPNs). 4. ElGamal:
Disk encryption (e.g., BitLocker, FileVault). o Based on the Diffie-Hellman key exchange.
o Used for encryption and digital signatures.
2. Asymmetric Encryption Use Cases:
Asymmetric encryption uses a pair of keys: a public key for encryption and Secure key exchange (e.g., TLS handshake).
a private key for decryption. It solves the key distribution problem of Digital signatures (e.g., signing software or documents).
symmetric encryption but is slower and computationally more intensive. Authentication (e.g., SSH, SSL/TLS).
3. Hybrid Encryption
Hybrid encryption combines the strengths of symmetric and asymmetric
encryption. Typically, asymmetric encryption is used to securely exchange a
symmetric key, which is then used for bulk data encryption.
Example:
In TLS/SSL, RSA or ECC is used to exchange an AES key, which is
then used to encrypt the session data.
4. Hashing
Key Characteristics: While not an encryption technique, hashing is often used alongside
Two keys: public key (shared) and private key (kept secret). encryption for data integrity and authentication. A hash function converts
Slower than symmetric encryption. data into a fixed-size string of characters, which is unique to the input data.
Used for key exchange, digital signatures, and authentication. Key Characteristics:
Provides non-repudiation. One-way function (cannot be reversed).
Common Asymmetric Encryption Algorithms: Fixed output size (e.g., 256 bits for SHA-256).
1. RSA (Rivest-Shamir-Adleman): Used for verifying data integrity and storing passwords.
o Key sizes: 1024, 2048, or 4096 bits.
2
AC3401 Information Coding Techniques Unit V Cryptography
3
AC3401 Information Coding Techniques Unit V Cryptography
4
AC3401 Information Coding Techniques Unit V Cryptography
o Known for its flexibility and security. o Used in VPNs, TLS/SSL, and secure messaging apps.
5. ChaCha20: 3. Disk Encryption:
o Stream cipher developed by Daniel J. Bernstein. o Encrypting entire disks or partitions to protect data at rest.
o Key size: 256 bits. 4. Wireless Security:
o Used in modern protocols like TLS and VPNs. o Used in protocols like WPA2 and WPA3 for securing Wi-Fi
o Faster than AES in software implementations. networks.
5
AC3401 Information Coding Techniques Unit V Cryptography
6
AC3401 Information Coding Techniques Unit V Cryptography
5. Final Permutation (FP) Still considered less efficient than modern algorithms like AES.
After 16 rounds, the halves are combined and permuted using the Modes of Operation for DES
inverse of the initial permutation. 1. ECB (Electronic Codebook):
Strengths of DES o Encrypts each 64-bit block independently.
1. Historical Significance: o Vulnerable to pattern analysis (identical plaintext blocks
o DES was the first encryption standard to be widely adopted produce identical ciphertext blocks).
and implemented. 2. CBC (Cipher Block Chaining):
2. Efficiency: o Each block is XORed with the previous ciphertext block
o DES is relatively fast and efficient in hardware before encryption.
implementations. o Requires an initialization vector (IV) to ensure uniqueness.
3. Foundation for Modern Cryptography: 3. CFB (Cipher Feedback):
o DES introduced concepts like Feistel networks and o Converts DES into a stream cipher.
substitution-permutation networks, which influenced later o Encrypts small units of data (e.g., bytes).
algorithms. 4. OFB (Output Feedback):
Weaknesses of DES o Converts DES into a stream cipher.
1. Short Key Length: o Uses the output of the encryption process as feedback for the
o The 56-bit key is vulnerable to brute-force attacks. Modern next block.
computers can break DES in hours or even minutes. Applications of DES
2. Vulnerability to Attacks: 1. Historical Use:
o DES is susceptible to attacks like differential cryptanalysis o DES was widely used in financial systems, secure
and linear cryptanalysis. communications, and government applications.
3. Outdated Security: 2. Legacy Systems:
o Advances in computing power have rendered DES insecure o Some legacy systems still use DES or 3DES for backward
for modern applications. compatibility.
Triple DES (3DES) 3. Educational Purposes:
To address DES's weaknesses, Triple DES (3DES) was introduced. It o DES is often studied in cryptography courses to understand
applies the DES algorithm three times with two or three different keys, foundational concepts.
increasing the effective key length to 112 or 168 bits. Security Considerations
3DES Encryption Process: 1. Brute-Force Attacks:
1. Encrypt with Key 1. o DES's 56-bit key can be broken by modern computers using
2. Decrypt with Key 2. brute-force methods.
3. Encrypt with Key 3. 2. Differential and Linear Cryptanalysis:
Advantages of 3DES: o DES is vulnerable to these advanced cryptographic attacks.
Provides stronger security than DES. 3. Replacement by AES:
Backward compatible with DES. o AES (Advanced Encryption Standard) has replaced DES as
Disadvantages of 3DES: the standard for secure encryption due to its longer key
Slower than DES due to triple processing. lengths (128, 192, or 256 bits) and stronger security.
7
AC3401 Information Coding Techniques Unit V Cryptography
3. Output Transformation
After 8 rounds, perform the final transformation:
o Multiply X1X1 with subkey K49K49.
8
AC3401 Information Coding Techniques Unit V Cryptography
o Add X2X2 with subkey K50K50. 2. Security: Based on the difficulty of factoring large integers.
o Add X3X3 with subkey K51K51. 3. Key Sizes: Typically 1024, 2048, or 4096 bits.
o Multiply X4X4 with subkey K52K52. 4. Applications: Secure communication, digital signatures, and key
The result is the 64-bit ciphertext. exchange.
4. Decryption Process
Decryption uses the same structure as encryption but with inverse
subkeys.
Subkeys are derived by:
o Taking the multiplicative inverse for multiplication subkeys.
o Taking the additive inverse for addition subkeys.
Advantages of IDEA
1. Strong Security: Resistant to known cryptographic attacks.
2. Efficiency: Fast in both hardware and software implementations.
3. Flexibility: Can be used in various encryption applications.
Applications of IDEA
1. PGP (Pretty Good Privacy): Used for secure email communication.
2. Secure File Transfer: Encrypts files for secure storage or
transmission. Step-by-Step RSA Algorithm
3. VPNs (Virtual Private Networks): Provides data confidentiality. 1. Key Generation
1. Choose Two Large Prime Numbers:
Example o Select two distinct prime numbers pp and qq.
Plaintext: 64-bit block (e.g., 0123456789ABCDEF in hex). o Example: p=61p=61, q=53q=53.
Key: 128-bit key 2. Compute nn (Modulus):
(e.g., 00112233445566778899AABBCCDDEEFF in hex). o n=p×qn=p×q.
Ciphertext: Encrypted 64-bit block after IDEA processing. o Example: n=61×53=3233n=61×53=3233.
3. Compute Euler's Totient Function ϕ(n)ϕ(n):
RSA Algorithm o ϕ(n)=(p−1)×(q−1)ϕ(n)=(p−1)×(q−1).
The RSA algorithm is a widely used public-key cryptosystem for secure o Example: ϕ(n)=60×52=3120ϕ(n)=60×52=3120.
data transmission. It was invented in 1977 by Ron Rivest, Adi Shamir, 4. Choose Public Key ee:
and Leonard Adleman. RSA relies on the mathematical properties of prime o Select ee such
numbers and modular arithmetic for encryption and decryption. that 1<e<ϕ(n)1<e<ϕ(n) and gcd (e,ϕ(n))=1gcd(e,ϕ(n))=1.
o Example: e=17e=17.
Key Features of RSA 5. Compute Private Key dd:
1. Asymmetric Cryptography: Uses a pair of keys (public and private). o dd is the modular multiplicative inverse
of ee modulo ϕ(n)ϕ(n).
9
AC3401 Information Coding Techniques Unit V Cryptography
10
AC3401 Information Coding Techniques Unit V Cryptography
2. Decryption:
The recipient uses their private key to decrypt the
session key.
The session key is then used to decrypt the message.
The message is decompressed to retrieve the original
plaintext.
3. Digital Signature:
The sender creates a hash of the message and encrypts
it with their private key to create a digital signature.
The recipient decrypts the signature using the sender's
public key and compares the hash with a newly
computed hash of the received message to verify
authenticity and integrity.
Advantages:
o Confidentiality: Ensures that only the intended recipient can
read the message.
o Authentication: Verifies the identity of the sender.
o Integrity: Ensures that the message has not been altered
during transmission.
o Non-repudiation: Prevents the sender from denying that they
oDigital Signatures: Used for authentication and integrity
verification. PGP uses a hash function to create a message sent the message.
Disadvantages:
digest, which is then encrypted with the sender's private key
o Complexity: Requires users to manage public and private
to create the digital signature.
o Compression: PGP compresses the data before encryption to
keys.
o Key Management: Losing the private key can result in loss
save space and improve security.
o Radix-64 Encoding: Converts binary data to ASCII text
of access to encrypted data.
format for easy transmission over email or other text-based o Performance: Encryption and decryption can be
systems. computationally intensive, especially for large files.
How PGP Works: 2. One-Way Hashing
Overview:
1. Encryption:
o One-way hashing is a cryptographic process that takes an
The sender compresses the plaintext message.
A random symmetric key (session key) is generated
input (or message) and produces a fixed-size string of bytes,
and used to encrypt the compressed message. typically a hash value.
o The process is "one-way" in the sense that it is
The session key is then encrypted using the recipient's
public key. computationally infeasible to reverse the process and obtain
The encrypted session key and the encrypted message
the original input from the hash value.
are sent to the recipient.
11
AC3401 Information Coding Techniques Unit V Cryptography
o Hashing is commonly used for data integrity verification, o SHA-1 (Secure Hash Algorithm 1): Produces a 160-bit hash
password storage, and digital signatures. value. It is also considered insecure and deprecated for most
cryptographic purposes.
o SHA-2 (Secure Hash Algorithm 2): A family of hash
functions that includes SHA-224, SHA-256, SHA-384, and
SHA-512. SHA-256 and SHA-512 are widely used and
considered secure.
o SHA-3 (Secure Hash Algorithm 3): The latest member of the
Secure Hash Algorithm family, designed as an alternative to
SHA-2.
Applications of One-Way Hashing:
o Data Integrity: Hashing is used to verify that data has not
been altered. For example, file checksums are used to ensure
that a file has not been corrupted during transmission.
o Password Storage: Instead of storing plaintext passwords,
systems store the hash of the password. When a user logs in,
the system hashes the entered password and compares it to the
stored hash.
o Digital Signatures: Hashing is used in the creation of digital
Key Properties:
signatures to ensure the integrity and authenticity of a
o Deterministic: The same input will always produce the same
message.
hash value.
o Blockchain: Hashing is a fundamental component of
o Fast Computation: The hash function should quickly
blockchain technology, used to link blocks together and
compute the hash value for any given input.
ensure the integrity of the blockchain.
o Pre-image Resistance: It should be computationally
Advantages:
infeasible to reverse the hash function and obtain the original
o Security: Provides a secure way to verify data integrity and
input.
authenticity.
o Small Changes in Input: A small change in the input should
o Efficiency: Hashing is computationally efficient, making it
produce a significantly different hash value (avalanche
suitable for large volumes of data.
effect).
o Non-reversibility: The one-way nature of hashing ensures
o Collision Resistance: It should be computationally infeasible
that the original data cannot be easily retrieved from the hash
to find two different inputs that produce the same hash value.
value.
Common Hash Algorithms:
Disadvantages:
o MD5 (Message Digest Algorithm 5): Produces a 128-bit
o Collision Vulnerability: Although rare, collisions (two
hash value. However, it is considered insecure due to
different inputs producing the same hash) can occur,
vulnerabilities to collision attacks.
especially with weaker hash algorithms.
12
AC3401 Information Coding Techniques Unit V Cryptography
13