What Is Network Security?

Security objectives:

  • Confidentiality — only sender and receiver understand the message
  • Authenticity — sender/receiver are who they claim to be
  • Integrity — message was not modified in transit
  • Availability — network services are accessible when needed

Principles of Cryptography

Symmetric Key Cryptography

Both sender and receiver share the same key K.

AlgorithmTypeKey SizeNotes
Caesar cipherMonoalphabetic26Trivially breakable (frequency analysis)
Polyalphabetic (Vigenere)PolyalphabeticVariableStronger but breakable
DESBlock cipher56 bitsBroken by brute force (1998)
3DESBlock cipher168 bitsTriple DES: K1 encrypt, K2 decrypt, K3 encrypt
AES (Rijndael)Block cipher128/192/256 bitsCurrent standard

Symmetric encryption: K_A-B encrypts the message; K_A-B decrypts the message. Security depends on keeping K_A-B secret.

Public Key Encryption

Each party has a public key (known to all) and a private key (kept secret).

RSA Algorithm:

  1. Choose two large primes p and q
  2. Compute n = pq, z = (p-1)(q-1)
  3. Choose e where 1 < e < z and gcd(e, z) = 1
  4. Choose d such that e*d mod z = 1
  5. Public key: (n, e) — Private key: (n, d)
  6. Encrypt: c = m^e mod n
  7. Decrypt: m = c^d mod n

RSA security depends on the difficulty of factoring n = pq.

Message Integrity and Digital Signatures

Cryptographic Hash Functions

  • Takes an arbitrary-length input, produces a fixed-length output (message digest)
  • Properties: one-way, collision-resistant
  • MD5: 128-bit hash (broken, collision found)
  • SHA-1: 160-bit hash (weak, collision found)
  • SHA-2/SHA-3: current standards

Message Authentication Code (MAC)

  • Sender computes hash(message + s) where s is a shared secret
  • Receiver recomputes and verifies
  • Ensures both integrity and authenticity

Digital Signatures

  • Signing: sender encrypts hash of message with private key
  • Verification: receiver decrypts signature with public key, compares hashes
  • Provides non-repudiation (sender cannot deny signing)

Sign then encrypt: Compute signature (sign hash with private key), then encrypt (message + signature) with receiver’s public key. Both confidentiality and authenticity.

Public Key Certification (CA):

  • Certificate Authority (CA) binds a public key to an entity’s identity
  • CA verifies identity, then creates a signed certificate (entity’s public key + identity, signed by CA’s private key)
  • Certificate hierarchy: root CAs sign intermediate CAs, which sign server certificates

End-Point Authentication

Evolution of authentication protocols:

ProtocolMethodWeakness
ap1.0“I am Alice” (IP address)IP spoofing
ap2.0Secret passwordPacket sniffing
ap3.0Encrypted passwordPlayback attack (replay)
ap3.1Encrypted password + sequence numberSequence number prediction
ap4.0Nonce + encrypt(nonce, shared secret)Secure — protects against replay

Securing E-Mail

PGP (Pretty Good Privacy):

  • Combines symmetric + public key cryptography
  • Message encrypted with one-time session key (symmetric)
  • Session key encrypted with receiver’s public key
  • Signed with sender’s private key
  • Provides confidentiality, integrity, authenticity

Securing TCP Connections: SSL

SSL (Secure Sockets Layer) / TLS (Transport Layer Security):

SSL Handshake (4 phases):

  1. Client sends: list of supported crypto algorithms + client nonce
  2. Server responds: chosen algorithm + certificate (with server’s public key) + server nonce
  3. Client: verifies certificate, generates Pre-Master Secret (PMS), encrypts with server’s public key, sends encrypted PMS + MAC key
  4. Client and server: both derive Master Secret from PMS + nonces, then derive encryption keys and MAC keys

Key derivation:

  • MS = PRF(PMS, “master secret”, ClientNonce + ServerNonce)
  • Encryption keys, MAC keys, IVs derived from MS

SSL Data Transfer Record:

  • Fragment data into blocks
  • Compute MAC (using MAC key)
  • Pad if using CBC mode
  • Encrypt (using encryption key)
  • Add header (content type, version, length)

Network-Layer Security: IPsec and VPNs

IPsec services: confidentiality, integrity, authentication, replay protection.

AH (Authentication Header): provides integrity and authentication (no encryption).

ESP (Encapsulating Security Payload): provides integrity and confidentiality (encryption).

Security Association (SA): one-way logical connection between sender and receiver. Defines: key, algorithm, SPI, lifetime.

IKE (Internet Key Exchange): protocol for establishing SAs (authenticated Diffie-Hellman).

IPsec Transport Mode: SA between two hosts; only payload is encrypted. IPsec Tunnel Mode: SA between two gateways; entire original IP datagram is encrypted + new IP header added (used for VPNs).

Securing Wireless LANs

FeatureWEP802.11i (WPA2)
EncryptionRC4 (broken)AES-CCMP
Key managementStatic, shared key4-way handshake, per-session keys
IntegrityCRC-32 (linear)MIC (Michael / CCMP)
AuthenticationOpen/Shared key802.1X authentication
SecurityCompletely brokenStrong (with proper auth)

WPA2 4-way handshake:

  1. AP sends nonce to client
  2. Client sends nonce + MIC to AP
  3. AP sends GTK + MIC to client
  4. Client ACKs

Operational Security: Firewalls and IDS

Firewalls:

  • Isolate organization’s internal network from the public Internet
  • Stateless packet filter: examines each packet independently (IP, port, protocol)
  • Stateful packet filter: tracks connection state (TCP handshake, sequence numbers)
  • Application gateway: proxies application-level traffic (e.g., HTTP proxy)

IDS (Intrusion Detection System):

  • Signature-based: match patterns of known attacks
  • Anomaly-based: detect deviations from normal traffic

IPS (Intrusion Prevention System): inline IDS that drops suspicious packets.


References

  • Computer Networking: A Top-Down Approach, 7th Edition — Kurose & Ross, Pearson, 2017
  • RFC 4251 — Secure Shell (SSH)
  • RFC 5246 — TLS 1.2
  • RFC 4301 — IPsec Architecture
  • IEEE 802.11i — Wireless Security Standard