Confidentiality: only sender, intended receiver should understand message contents
Sender encrypts message
Receiver decrypts message
Authentication: sender, receiver want to confirm identity of each other
Message integrity: sender, receiver want to ensure message not altered (in transit, or afterwards) without detection
Access and availability: services must be accessible and available to users
Attacks on internet security
Bob and Alice want to communicate securely each other. Trudy (intruder) may interrupt!
Eavesdrop: intercept messages
Actively insert messages into connection
Impersonation: can fake (spoof) source address in packet (or any field in packet)
Hijacking: take over ongoing connection by removing sender or receiver, then inserting himself in place
Denial of Service: prevent service from being used by others (e.g. by overloading resources)
Cryptography
Alice wants to send a plaintext message m. She sends a ciphertext KA(m) encrypted with her encryption key KA. Bob decrypt it with Bob's decryption key KB, and get the original message m.
Breaking an encryption scheme
Cipher-text only attack: Trudy has ciphertext she can analyze.
Brute force: Search through all keys
Statistical analysis
Known-plaintext attack: Trudy has plaintext and corresponding ciphertext. (e.g. ciphertext for a, b, c, ...)
Chosen-plaintext attack: Trudy can get ciphertext for chosen plaintext.
Symmetric key cryptography
Bob and Alice share same (symmetric) key KS. Bob and Alice should agree on key value.
Substitution cipher
Substitute one letter for another. Encryption key is mapping from set of 26 letters (alphabets) to set of 26 letters.
We can also use n subtitution ciphers (e.g. M1,M2,M3,M4,M5) and cycling pattern. (e.g. M1,M3,M4,M5,M2).
For each new letter, use subsequent substitution pattern in cyclic pattern. e.g. When encrypting dog, encrypt d with M1, encyrpt o with M3, then encrypt g with M4. Encryption key is n substitution ciphers and cyclic pattern.
Attack on Substitution cipher
If input is same, output is always same! Statistical analysis can be used to get the mapping.
DES, AES
DES (Data Encyrption Standard) is US encryption standard, (NIST 1993) but it can be decrypted in less than a day with bruteforce. However, there are no known good analytic attack. 3DES was used briefly, which encrypt 3 times using DES, with 3 different keys.
Later AES replaced DES in November 2001. Brute force decryption takes 149 trillion years for AES. This is widely used, and even CPU and datacenter network cards have hardware implementation for AES.
Public key cryptography
Alice and Bob have public key and private key. Public encryption key is known to everyone, but private decryption key is known only to them.
Alice encrypt plaintext message m with Bob's public key KB+.
Bob decrypt ciphertext KB+(m) with Bob's private key KB−.
Ciphertext can't decrypted with public key! We can just open public key to anyone.
Requirements of public key cryptography
Private key can decrypt message encrypted with public key.
Private key can't be computed from public key.
Obviously, public key and private keys are paired! We cannot change only one of the keys.
RSA (Rivest, Shamir, Adelson) algorithm
Every message can be represented as bit pattern, and bit pattern can be uniquely represented by an integer number. Therefore, we can encrypt any message if we can encrypt any number.
RSA is actually slower than AES, so normally we use RSA to only establish secure connection. First, Bob and Alice use RSA to exchange a symmetric session key. Then, they use symmetric key cryptography to actually send the data.
Creating public/private key pair
Choose two large prime numbers p, q. (Normally 1024 bits)
n=pq,z=(p−1)(q−1).
Choose e<n that has no common factors with z. (i.e. e and z are relatively prime)
Choose d such that ed−1 is divisible by z. (i.e. edmodz=1)
Public key is KB+=(n,e), and private key is KB−=(n,d).