Cryptology
🔐 Cryptology
Cryptology is the science that deals with secure communication, ensuring data remains confidential, authentic, and unaltered. It is divided into two major branches:
1. Cryptography
Cryptography is the art and science of creating secure systems. It focuses on protecting information using various techniques like encryption, hashing, and digital signatures.
Main goals of cryptography:
-
Confidentiality: Ensures that only intended recipients can read the information.
-
Integrity: Ensures that the message has not been altered in transit.
-
Authentication: Verifies the identity of the sender or receiver.
-
Non-repudiation: Prevents the sender from denying they sent the message.
2. Cryptanalysis
Cryptanalysis is the practice of breaking cryptographic systems. The goal is to access information without knowing the secret keys or to find weaknesses in encryption algorithms.
Common cryptanalysis methods include:
-
Brute force attacks, where every possible key is tried.
-
Frequency analysis, especially effective on classical ciphers.
-
Known-plaintext attacks, where part of the original message is known.
-
Chosen-plaintext and chosen-ciphertext attacks, where the attacker has more control over the inputs.
3. Types of Cryptography
Symmetric Key Cryptography:
This involves a single secret key used for both encryption and decryption. It is fast but requires a secure method for key exchange.
Examples include AES, DES, and Blowfish.
Asymmetric Key Cryptography:
This method uses a public key for encryption and a private key for decryption. It is secure for key exchange and digital signatures but slower than symmetric encryption.
Examples include RSA, Elliptic Curve Cryptography (ECC), and Diffie-Hellman.
4. Hashing (One-Way Encryption)
Hashing converts data into a fixed-length string (hash value or digest) and is not reversible. It is used to verify data integrity and to store passwords securely.
Common algorithms include SHA-256, SHA-1, and MD5.
5. Classical vs. Modern Cryptography
Classical cryptography refers to simple encryption methods used in the past, like Caesar cipher, Atbash, and Vigenère. These are typically easy to break with modern techniques.
Modern cryptography is based on complex mathematical problems and includes both symmetric and asymmetric techniques. It is used in everything from secure websites to cryptocurrencies.
6. Real-World Applications of Cryptology
-
Email encryption: Tools like PGP ensure that only the intended recipient can read the message.
-
Secure websites: SSL/TLS protocols encrypt data sent between browsers and servers.
-
Digital signatures: Authenticate the sender and ensure message integrity.
-
Cryptocurrencies: Rely on cryptographic algorithms for secure, decentralized transactions.
-
VPNs: Use encryption to protect internet traffic from eavesdropping.
🔐 Cryptology MCQs with Answers and Explanations
Q1. Which of the following algorithms is symmetric in nature?
A. RSA
B. Diffie-Hellman
C. AES
D. ECC
Answer: ✅ C. AES
Explanation: AES (Advanced Encryption Standard) is a symmetric encryption algorithm, meaning it uses the same key for encryption and decryption. RSA, ECC, and Diffie-Hellman are asymmetric algorithms.
Q2. In public-key cryptography, the public key is used for:
A. Decryption only
B. Both encryption and decryption
C. Encryption only
D. Key generation
Answer: ✅ C. Encryption only
Explanation: In public-key (asymmetric) cryptography, the public key encrypts, and the private key decrypts. This allows anyone to send a confidential message to the key owner.
Q3. Which cryptographic hash function produces a 256-bit output?
A. MD5
B. SHA-1
C. SHA-256
D. SHA-512
Answer: ✅ C. SHA-256
Explanation: SHA-256 (Secure Hash Algorithm 256-bit) produces a 256-bit (32-byte) hash output. MD5 outputs 128-bit, SHA-1 outputs 160-bit, and SHA-512 outputs 512-bit.
Q4. What is the primary use of a digital signature?
A. To encrypt a message
B. To ensure data confidentiality
C. To verify data authenticity and integrity
D. To compress data
Answer: ✅ C. To verify data authenticity and integrity
Explanation: A digital signature ensures that a message:
-
Is from a verified sender (authenticity)
-
Has not been altered (integrity)
It uses the sender's private key to sign a hash of the message.
Q5. Which of the following is not a property of a cryptographic hash function?
A. Determinism
B. Collision resistance
C. Fast invertibility
D. Avalanche effect
Answer: ✅ C. Fast invertibility
Explanation: Cryptographic hash functions are one-way functions—they should not be easily invertible (i.e., you can't derive the input from the output).
Q6. RSA algorithm security relies on the difficulty of:
A. Factoring large prime numbers
B. Computing discrete logarithms
C. Integer multiplication
D. Solving linear equations
Answer: ✅ A. Factoring large prime numbers
Explanation: RSA security depends on the computational difficulty of factoring large semiprime numbers (product of two large primes).
Q7. What is the main difference between stream and block ciphers?
A. Stream ciphers use fixed-length keys; block ciphers do not
B. Block ciphers encrypt bit-by-bit; stream ciphers encrypt blocks
C. Stream ciphers encrypt data in real time, block ciphers encrypt fixed-size blocks
D. None of the above
Answer: ✅ C. Stream ciphers encrypt data in real time, block ciphers encrypt fixed-size blocks
Explanation:
-
Block ciphers: Encrypt data in fixed-size blocks (e.g., AES uses 128-bit blocks)
-
Stream ciphers: Encrypt one bit or byte at a time, often used in real-time systems.
Q8. Which key exchange algorithm enables two parties to establish a shared secret over an insecure channel?
A. RSA
B. SHA-256
C. Diffie-Hellman
D. AES
Answer: ✅ C. Diffie-Hellman
Explanation: The Diffie-Hellman key exchange algorithm enables two parties to generate a shared secret key even over untrusted networks.
Q9. Which of the following best describes Elliptic Curve Cryptography (ECC)?
A. It is faster and more secure than RSA with shorter key lengths
B. It uses block cipher techniques
C. It is used only for hashing
D. It is a symmetric encryption scheme
Answer: ✅ A. It is faster and more secure than RSA with shorter key lengths
Explanation: ECC offers the same level of security as RSA but with much smaller key sizes. It's commonly used in mobile and resource-constrained environments.
Q10. Which of the following is an example of a message authentication code (MAC)?
A. HMAC
B. AES
C. RSA
D. ECC
Answer: ✅ A. HMAC
Explanation: HMAC (Hash-based Message Authentication Code) is a MAC that uses a cryptographic hash function and a secret key to verify message integrity and authenticity.