From 8fa0c6896b1684f336efe6b41384edb94e66b882 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Thu, 20 Oct 2022 12:35:02 +1300 Subject: [PATCH] vault backup: 2022-10-20 12:35:02 --- content/notes/24-network-security.md | 54 ++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/content/notes/24-network-security.md b/content/notes/24-network-security.md index 58e07012b..9a1c4637f 100644 --- a/content/notes/24-network-security.md +++ b/content/notes/24-network-security.md @@ -29,11 +29,61 @@ what can trudy to terminology - m: plaintext message -- +- $K_{A}(m)$: ciphertext, encrypted with key $K_{A}$ +- m = $K_{B}(K_{A}(m))$ +- ![](https://i.imgur.com/6veueus.png) +- key: secret data used to encrypt and decrypt messages # Symmetric key crypto +bob and alice share the same key K +- e.g., key is knowing a substitution pattern in mono alphabetic substitution cipher +- substiution cipher + - map each letter to a different letter + - key is a mapping from a set of 26 letters to another set of 26 letters + - not secure: easy to decrypt using patterns etc + +DES: data encryption standard +- data is split into blocks of 64 bits +- each block encrypted using 56-bit key +- blocks are chained together + - encryption of current block is based on the previous block +- 56-bit symmetric key, 64 kit plaintext input +- not very secure: short key- only 56 bits - less than a day to brute force + - no known good analytic attack + - 3DES: encrypt 3 times with 3 different keys: more secure + +AES: advanced encryption standard +- larger key 128, 192 or 256 +- 128-bit blocks +- brute force taking 1 sec on DES takes 149 trillion years for AES + +# Public key crypto +symmetric requires sharing of key + +process +- sender and reciever do not share secret key +- public key known to all +- pricate key known ony to reciever + +- use public key to encrypt +- use private key to decrypt + +public key reqs +- ![](https://i.imgur.com/DrH8hmU.png) + +RSA +- popular public key encruption algorithm +- how to generate keys + - choose two large prime numbers (1024 bits each) + - compute $n=pq, z=(p-1)(q-1)$ + - choose e (with e