VPN
VPN
VPN
A Virtual Private Network (VPN) provides a secure tunnel across a public (and
thus, insecure) network. This provides a mechanism for organizations to connect
users and offices together, without the high costs of dedicated leased lines.
VPNs are most often used across the Internet, the world’s largest public
network, providing users with access to email, documents, printers, and systems
as if they were actually at their central office.
VPN Benefits:
• Cost Saving
• Security
• Scalability
• Compatibility
Page | 1
IPsec
Data sent in clear-text across the Internet can easily be intercepted and
stolen. Because of this, sensitive data should be encrypted when sent across
an untrusted network or domain.
Keys are generated values used to both encrypt and decrypt data. The longer
the key, the more secure that key is. The length of a key is measured in bits.
Two “types” of keys exist:
Symmetric keys can be used to both encrypt and decrypt data. More
specifically, the same key is used to both encrypt a packet (at the sending
device) and then decrypt that packet (at the receiving device). Symmetric
key encryption is efficient but does not scale well in large environments.
Page | 2
Symmetric keys are not openly shared during data transmit and must instead
be installed on each machine prior to the transfer of data. This can be
accomplished using a variety of (inefficient and insecure) methods: email,
sneaker-net, and even snail-mail. Each device on a network would require
every other device’s symmetric key, and thus the lack of scalability.
Asymmetric keys require a separate key for encryption (the public key) and
decryption (the private key). Public keys are openly exchanged between
devices to encrypt data during transfer. Private keys are never exchanged.
The generated public keys encrypt data payload using one of several
available encryption algorithms:
Page | 3
Data Integrity and Hashing
Data sent across the Internet can not only be stolen but can also be
maliciously altered.
To combat this, a hashing algorithm computes and appends a specific hash
value as each packet is sent. Once the data is received, it is run through the
hashing algorithm again. If the hash value is different, the packet was altered
in transit.
Hashed Message Authentication Code (HMAC) is used to perform this
hashing function. HMAC utilizes a secret key when computing the hash
value, thus preventing an attacker from altering the packet and then
recomputing the correct hash.
Two HMAC algorithms are commonly used:
• HMAC-MD5 (Message-Digest 5) – 128-bit hashed key
• HMAC-SHA1 (Secure Hash Algorithm) – 160-bit hashed key
Page | 4
Authentication
Another concern when sending data across the Internet is the source or
origin of that data. It is possible to masquerade or spoof one’s identity or
address.
For an IPSEC VPN tunnel to be established, both sides of the tunnel must be
authenticated. To accomplish this, either pre-shared keys or RSA digital
signatures are used.
When using pre-shared keys, a secret string of text is used on each device
to authenticate each other. This string must be pre-agreed upon and identical
on each device. This string is then hashed into a digital signature.
Page | 5
The IPSEC Protocols
Page | 6
Transport vs. Tunnel Modes
Each IPSEC protocol (AH or ESP) can operate in one of two modes:
• Transport mode – Original IP headers are left intact. Used when
securing communication from one device to another single device.
• Tunnel mode – the entire original packet is hashed and/or encrypted,
including both the payload and any original headers. A temporary IP
header is applied to the packet during transit. Used to tunnel traffic
from one site to another.
The following demonstrates how AH alters an IP packet:
ESP in Tunnel mode experiences NAT difficulties similar to AH. This can
be alleviated by implementing NAT Traversal (NAT-T).
Page | 7
IKE and IPSEC Security Associations
Page | 8
IKE Phase 2 establishes the IPSEC tunnel (IPSEC SA), which details the
AH or ESP parameters for securing data. These parameters are contained in
an IPSEC Transform Set.
IKE Phase 1 negotiates parameters for the tunnel (key exchange) itself,
while IKE Phase 2 negotiates parameters for the data traversing that tunnel.
Page | 9