Basic Concepts of Cryptography in Computer Networks
1. Network Security Goals: The CIA Triad
In modern interconnected computer networks, information security revolves around three fundamental security pillars (the CIA Triad), plus authentication and non-repudiation:
- Confidentiality: Ensuring that sensitive information is inaccessible to unauthorized eavesdroppers. Achieved via Encryption.
- Integrity: Ensuring that data has not been secretly modified, injected, or altered during transit. Achieved via Cryptographic Hash Functions and MACs.
- Availability: Ensuring authorized users have reliable, timely access to services without disruption from Denial of Service (DoS) attacks.
- Authentication: Confirming the true identity of communicating entities before granting access.
- Non-Repudiation: Preventing a sender from denying having sent a message. Achieved via Digital Signatures.
2. Cryptographic Terminology
- Plaintext (): The original, unencrypted readable message.
- Ciphertext (): The scrambled, unreadable message produced by encryption.
- Cipher: The mathematical algorithm used to transform plaintext into ciphertext.
- Key (): A mathematical secret parameter used by ciphers to control encryption and decryption.
- Encryption ():
- Decryption ():
- Cryptanalysis: The science of breaking ciphers and decrypting data without knowledge of the secret key.
- Kerckhoffs's Principle: A cryptosystem must remain secure even if everything about the system (the algorithm) is public knowledge, as long as the Key itself remains secret.
3. Symmetric Key Cryptography (Secret-Key)
In Symmetric Key Cryptography, the exact same secret key is used for both encryption and decryption:
Classification of Symmetric Ciphers:
- Stream Ciphers: Encrypts plaintext bit-by-bit or byte-by-byte continuously (e.g., RC4, ChaCha20).
- Block Ciphers: Divides plaintext into fixed-size blocks (typically 64 or 128 bits) and encrypts each block:
- DES (Data Encryption Standard): 56-bit key, 64-bit block size. Obsolete (cracked via brute-force in hours).
- 3DES (Triple DES): Applies DES three times (-bit key). Phased out due to slow performance.
- AES (Advanced Encryption Standard - Rijndael): The global gold standard. Fixed 128-bit block size with key lengths of 128, 192, or 256 bits.
The Key Distribution Problem:
For a network with users, every pair of users requires a distinct shared key:
In a network of users, nearly secret keys must be securely distributed and stored!
4. Asymmetric Key Cryptography (Public-Key)
To solve the key distribution nightmare, Whitfield Diffie and Martin Hellman introduced Public-Key Cryptography in 1976. Each user possesses a mathematically linked Key Pair:
- Public Key (): Freely published and known to the entire world.
- Private Key (): Kept strictly secret by the owner.
Mathematical Foundations:
Based on One-Way Trapdoor Functions—problems that are easy to compute in the forward direction but computationally infeasible to invert without special knowledge (the trapdoor):
- RSA (Rivest-Shamir-Adleman): Security relies on the extreme computational difficulty of factoring large prime numbers ().
- Diffie-Hellman / ECC (Elliptic Curve Cryptography): Security relies on the Discrete Logarithm Problem. ECC provides the same security as RSA with vastly smaller keys (256-bit ECC 3072-bit RSA).
5. Digital Signatures and Message Digests
Asymmetric cryptography also provides Authentication and Non-Repudiation through Digital Signatures:
- Cryptographic Hash Functions (SHA-256): One-way, fixed-size output, collision-resistant (impossible to find two different inputs that produce the same hash output).
- Digital Certificates & PKI (X.509): Trusted third-party Certificate Authorities (CAs) digitally sign and bind public keys to domain identities (e.g., Let's Encrypt, DigiCert) for HTTPS web browsing.
6. Hybrid Cryptography (The Real-World Solution)
- Symmetric encryption is faster than asymmetric encryption.
- Asymmetric encryption solves key distribution.
- The Modern Standard (TLS / SSL / HTTPS) combines both:
- Handshake Phase: Uses Asymmetric Cryptography (ECDH / RSA) to authenticate the server and securely exchange a temporary Symmetric Session Key.
- Data Transfer Phase: Uses Symmetric Cryptography (AES-256-GCM) with the negotiated session key to encrypt bulk data at wire speed!
7. Comprehensive Comparison: Symmetric vs. Asymmetric
| Parameter | Symmetric Encryption | Asymmetric Encryption |
|---|---|---|
| Number of Keys | 1 shared secret key | 2 mathematically linked keys (Public & Private) |
| Key Distribution | Difficult ( secret channels) | Simple ( public keys) |
| Computational Speed | Extremely Fast (Hardware accelerated) | Slow (Heavy modular exponentiation) |
| Cipher Text Size | Same as or slightly larger than plaintext | Significantly larger than plaintext |
| Primary Algorithms | AES, DES, 3DES, ChaCha20, Blowfish | RSA, ECC, Diffie-Hellman, DSA |
| Primary Use Cases | Bulk file encryption, database storage | Key exchange, Digital Signatures, TLS handshakes |
Frequently Asked Questions
QState Kerckhoffs's Principle.
A cryptographic system must be designed to remain secure even if everything about the design and algorithms are publicly known, provided the specific key remains secret.
QWhy is Hybrid Cryptography used in HTTPS/TLS rather than pure asymmetric encryption?
Asymmetric encryption involves heavy mathematical operations that are too slow for high-speed web traffic. HTTPS uses asymmetric cryptography only for initial key exchange and authentication, then switches to fast symmetric encryption (AES) for the actual webpage payload.
QWhat two properties are guaranteed by a Digital Signature?
Authentication / Non-Repudiation (proves the message was signed by the holder of the unique private key) and Integrity (proves the message was not modified in transit).
QHow many keys are needed for N users with symmetric cryptography?
Every pair of users needs a distinct shared key, so keys are required, which is . For 1,000 users that is nearly 500,000 keys.