Cryptography in Computer Networks
Introduction to Cryptography
Cryptography is the practice and study of techniques for secure communication in the presence of third parties called adversaries. In computer networks, cryptography ensures data confidentiality, integrity, authentication, and non-repudiation.
Key Objectives
- Confidentiality - Only authorized parties can access information
- Integrity - Information cannot be altered without detection
- Authentication - Verifying the identity of communicating parties
- Non-repudiation - Sender cannot deny sending a message
Basic Terminology
- Plaintext: Original message
- Ciphertext: Encrypted message
- Encryption: Converting plaintext to ciphertext
- Decryption: Converting ciphertext back to plaintext
- Key: Secret value used for encryption/decryption
Types of Cryptography
1. Symmetric Key Cryptography
Uses the same key for both encryption and decryption. Also known as secret-key cryptography.
Characteristics:
- Fast encryption/decryption
- Key distribution problem
- Examples: AES, DES, 3DES, RC4, Blowfish
Common Algorithms:
AES (Advanced Encryption Standard)
128/192/256-bit keys, block cipher, widely used
DES (Data Encryption Standard)
56-bit key, now considered insecure
2. Asymmetric Key Cryptography
Uses a pair of keys - public key (for encryption) and private key (for decryption). Also known as public-key cryptography.
Characteristics:
- Slower than symmetric cryptography
- Solves key distribution problem
- Enables digital signatures
- Examples: RSA, ECC, ElGamal, DSA
Common Algorithms:
RSA (Rivest-Shamir-Adleman)
Based on factorization of large prime numbers
ECC (Elliptic Curve Cryptography)
Smaller keys for equivalent security to RSA
3. Hash Functions
One-way functions that map data of arbitrary size to fixed-size values. Used for data integrity verification.
Characteristics:
- Deterministic - same input always produces same output
- Irreversible - cannot retrieve original data from hash
- Avalanche effect - small change in input changes output significantly
- Examples: SHA-1, SHA-2, SHA-3, MD5
Cryptographic Protocols in Networks
SSL/TLS
Secure Sockets Layer/Transport Layer Security provides secure communication over computer networks. Used in HTTPS.
- Uses both symmetric and asymmetric cryptography
- Provides encryption, authentication, and integrity
- Handshake protocol establishes secure session
IPSec
Internet Protocol Security provides security at the network layer.
- Two modes: Transport (end-to-end) and Tunnel (gateway-to-gateway)
- Provides authentication (AH) and encryption (ESP)
- Used in VPNs
PGP
Pretty Good Privacy provides cryptographic privacy and authentication for data communication.
- Used for email encryption
- Combines symmetric and asymmetric cryptography
- Uses web of trust model
Cryptographic Attacks
Attack Type | Description | Prevention |
---|---|---|
Brute Force | Trying all possible keys until correct one is found | Use longer keys, key stretching |
Man-in-the-Middle | Attacker secretly intercepts and relays messages | Authentication, digital certificates |
Replay | Capturing and resending valid data transmission | Timestamps, sequence numbers |
Side-channel | Gaining information from physical implementation | Constant-time algorithms, masking |
Birthday | Finding two inputs with same hash output | Use longer hash outputs (SHA-256+) |
Applications in Computer Networks
Secure Web Browsing (HTTPS)
SSL/TLS encrypts communication between web browsers and servers, protecting sensitive data like passwords and credit card numbers.
Virtual Private Networks (VPNs)
Creates secure, encrypted tunnels for remote access to private networks over public internet infrastructure.
Secure Email
Protocols like S/MIME and PGP use cryptography to protect email content and verify sender authenticity.
Wireless Security
WPA2/WPA3 protocols use AES encryption to secure Wi-Fi communications against eavesdropping.
Digital Signatures
Used in software distribution, contracts, and authentication to verify authenticity and integrity.
Blockchain
Cryptographic hashing and digital signatures form the foundation of blockchain technology and cryptocurrencies.
Future Trends in Cryptography
Post-Quantum Cryptography
Developing algorithms resistant to quantum computer attacks, as quantum computers could break current public-key cryptography.
Homomorphic Encryption
Allows computation on encrypted data without decrypting it first, enabling secure cloud computing.
Zero-Knowledge Proofs
Enables proving knowledge of a secret without revealing the secret itself, enhancing privacy.