Ins 4
Ins 4
DES (Data Encryption Standard) is a symmetric-key block cipher that encrypts data in 64-bit
blocks using a 56-bit key. It was developed in the 1970s by IBM and later adopted as a federal
standard by the U.S. National Institute of Standards and Technology (NIST).
1. Overview
Block Size: 64-bit
Key Size: 56-bit (actually 64-bit, but 8 bits are used for parity)
Rounds: 16
Structure: Feistel Network
Mode: Symmetric encryption (same key for encryption & decryption)
The original 64-bit key is reduced to 56 bits (by removing parity bits).
Sixteen 48-bit subkeys are generated using a key schedule.
1. Splitting the 64-bit data into two halves (Left (L) and Right (R)).
2. Expansion (E-Box): Expanding the 32-bit right half to 48 bits.
3. Key Mixing: XORing the expanded right half with a 48-bit subkey.
4. Substitution (S-Box): Using S-boxes to reduce 48-bit data to 32-bit.
5. Permutation (P-Box): Rearranging the bits.
6. Swapping: The new right half becomes the next round's left half.
3. Strengths of DES
Simple and fast encryption.
Was widely used in financial and government sectors.
4. Weaknesses of DES
Short Key Length (56-bit): Vulnerable to brute-force attacks.
Susceptibility to Differential & Linear Cryptanalysis
AES (Advanced Encryption Standard) is a symmetric key encryption algorithm used for secure
data encryption and decryption. It was established by the U.S. National Institute of Standards and
Technology (NIST) in 2001 and is widely used in applications requiring strong security.
1. Symmetric Encryption: Uses the same key for encryption and decryption.
2. Block Cipher: Operates on fixed-size data blocks of 128 bits.
3. Key Lengths: Supports three key sizes:
o AES-128 (128-bit key, 10 rounds)
o AES-192 (192-bit key, 12 rounds)
o AES-256 (256-bit key, 14 rounds)
4. High Security: Resistant to brute-force and other cryptographic attacks.
5. Fast Performance: Efficient for both hardware and software implementations.
AES follows a series of transformation steps to encrypt and decrypt data. The encryption process
consists of:
1. Key Expansion: Generates multiple round keys from the initial key.
2. Initial Round:
o AddRoundKey: XOR the input with the first round key.
3. Main Rounds (Repeated 9, 11, or 13 times based on key size):
o SubBytes: Substitute bytes using an S-box.
o ShiftRows: Shift rows of the matrix to the left.
o MixColumns: Mix data across columns for diffusion.
o AddRoundKey: XOR the state with a round key.
4. Final Round:
o SubBytes
o ShiftRows
o AddRoundKey (without MixColumns)
Decryption follows the reverse process using Inverse SubBytes, Inverse ShiftRows, and
Inverse MixColumns.
Applications of AES
Secure Communication (HTTPS, TLS, VPNs)
Data Protection (File encryption, disk encryption)
Wireless Security (Wi-Fi WPA2/WPA3)
Cryptographic Protocols (SSL/TLS, PGP, SSH)
AES is the gold standard for encryption and is widely used by governments, organizations, and
individuals for securing sensitive data.
RSA is a public-key cryptographic algorithm used for secure data transmission and
encryption. It is widely used in secure communications, such as SSL/TLS, digital signatures, and
data encryption.
1. Overview
Type: Asymmetric-key cryptography (Public Key Encryption)
Keys: Public Key (for encryption) & Private Key (for decryption)
Security Basis: Depends on the difficulty of factoring large prime numbers.
b) Encryption Process
c) Decryption Process
1. Compute the plaintext MMM using the private key: M=Cdmod nM = C^d \mod
nM=Cdmodn
3. Strengths of RSA
✔ Highly Secure (when large key sizes are used)
✔ Used in Digital Signatures & Secure Key Exchange
✔ No Need to Share a Secret Key (solves key distribution problems)
4. Weaknesses of RSA
❌ Slow Compared to Symmetric Algorithms (like AES)
❌ Vulnerable to Factorization Attacks (if small key sizes are used)
❌ Requires Large Key Sizes (2048-bit or higher recommended for security)
The Diffie-Hellman key exchange (DHKE) is a cryptographic method that allows two parties to
establish a shared secret over an insecure channel without transmitting the secret itself. It is
widely used in secure communication protocols such as SSL/TLS, SSH, and VPNs.
1. Overview
Type: Asymmetric key exchange algorithm
Purpose: Securely exchange a cryptographic key over an insecure channel
Security Basis: Relies on the difficulty of computing the Discrete Logarithm Problem
(DLP)
4. Strengths of Diffie-Hellman
✔ Secure key exchange over an insecure channel
✔ Used in secure communication protocols (TLS, SSH, IPsec, etc.)
✔ No prior secret key exchange required
5. Weaknesses of Diffie-Hellman
❌ Vulnerable to Man-in-the-Middle (MITM) Attacks (if authentication is not used)
❌ Does not provide encryption (only key exchange)
❌ Security relies on the size of ppp (larger primes increase security)
b) Session Hijacking
The attacker steals a session token (like a login session) and takes control of a user's
session.
c) HTTPS Spoofing
The attacker tricks users into believing they are on a secure HTTPS website when they
are actually on a fake site.
d) Wi-Fi Eavesdropping
e) DNS Spoofing
f) SSL Stripping
Hash Function
A hash function is a mathematical function that takes an input (data) and produces a fixed-size
output (hash value or digest). It is commonly used in cryptography, data integrity, and password
storage.
1. Characteristics of MD5
Input Size: Any length
Output Size: 128-bit (32 hex characters)
Fast Computation: Efficient but weak against modern attacks
Not Collision-Resistant: Can generate the same hash for different inputs
3. MD5 Example
Hashing "Hello"
mathematica
CopyEdit
Input: "Hello"
MD5 Hash: 8b1a9953c4611296a827abf8c47804d7
Changing even a single letter (e.g., "hello" instead of "Hello") produces a completely different
hash.
4. Security Weaknesses
❌ Collision Vulnerability: Two different inputs can produce the same hash.
❌ Not Suitable for Password Storage: Can be cracked using rainbow tables and brute-force
attacks.
❌ Not Secure for Digital Signatures: Vulnerable to hash collisions (e.g., forging documents).
🔴 MD5 is Deprecated
Changing one letter (e.g., "hello" instead of "Hello") completely changes the hash due to the
avalanche effect.
4. Applications of SHA
✔ Password Hashing (SHA-256, SHA-512)
✔ Digital Signatures (SHA-256 in Bitcoin, SSL/TLS)
✔ Data Integrity Verification (File checksums)
✔ Blockchain & Cryptocurrencies (SHA-256 in Bitcoin mining)
5. SHA vs. MD5
Feature SHA-256 MD5
Hash Length 256-bit 128-bit
Security Highly secure Weak (collision attacks)
Speed Slower than MD5 Faster but insecure
Usage Cryptography, Digital Signatures Checksums, Legacy Systems
The sender's message/document is hashed using a cryptographic hash function (SHA-256, SHA-
3, etc.).
The hash function ensures that even a small change in the message creates a completely
different hash.
Example:
mathematica
CopyEdit
Message: "Hello"
SHA-256 Hash:
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
Step 2: Signing the Hash
The sender uses their private key to encrypt the hash using an encryption algorithm like RSA,
DSA, or ECDSA.
This encrypted hash is the digital signature.
The original message and the digital signature are sent to the receiver.
The receiver uses the sender's public key to decrypt the digital signature and retrieve the
original hash.
The receiver also hashes the received message using the same hash function.
If both hashes match, the signature is valid (message is authentic and unaltered).
If they do not match, the message has been tampered with or is not from the claimed sender.
Sender Encrypts the hash with their private key (RSA, DSA, ECDSA)
Receiver Hashes the received message using the same hash function
Receiver Decrypts the digital signature using the sender’s public key
bit+ Signing
Stronger &
ECDSA (Elliptic Curve DSA) 256-bit+ Used in Bitcoin, Ethereum, TLS
Faster
❌ Disadvantages
1. Introduction
Mobile phones store sensitive data, including personal information, banking details, and business
communications. They are vulnerable to cyber threats, which can lead to data breaches, identity
theft, and financial losses.
Malicious software (spyware, ransomware, trojans) can steal data, track activities, or lock
devices.
Example: Joker malware (steals SMS and contacts).
🔹 Security Measures:
✔ Install apps only from official stores (Google Play, Apple App Store).
✔ Use antivirus software.
✔ Avoid clicking suspicious links in messages or emails.
2. Phishing Attacks
Hackers trick users into revealing sensitive information via fake emails, messages, or websites.
Example: Fake banking login pages.
🔹 Security Measures:
✔ Verify email and website URLs before entering login details.
✔ Never share OTPs or passwords.
✔ Enable spam filters and email authentication.
Attackers intercept data between your phone and a server over public Wi-Fi.
Example: Hackers stealing login credentials via fake Wi-Fi networks.
🔹 Security Measures:
✔ Avoid public Wi-Fi or use a VPN.
✔ Use websites with HTTPS encryption.
✔ Enable two-factor authentication (2FA) for important accounts.
4. SIM Swapping
Attackers convince mobile carriers to transfer a victim’s phone number to a new SIM card,
gaining access to SMS-based OTPs.
🔹 Security Measures:
✔ Use app-based authentication (Google Authenticator, Authy) instead of SMS OTPs.
✔ Set a PIN lock for your SIM card.
✔ Contact your carrier for extra security measures.
🔹 Security Measures:
✔ Check app permissions before installing.
✔ Disable background data access for untrusted apps.
✔ Use privacy-focused apps.
🔹 Security Measures:
✔ Enable screen lock (PIN, fingerprint, or Face ID).
✔ Enable remote wipe (Find My iPhone, Google Find My Device).
✔ Encrypt sensitive data stored on the phone.
Attackers can steal data or install malware through open Bluetooth/NFC connections.
🔹 Security Measures:
✔ Keep Bluetooth and NFC disabled when not in use.
✔ Set devices to "Not Discoverable" mode.
🔹 Security Measures:
✔ Keep the OS and apps updated.
✔ Enable automatic updates.
✔ Use trusted brands that provide long-term security updates.