Exam - Encryption Flashcards
why internet needs encryption
recall: internet packets are relayed to destination through intermediate devices –> therefore could be potentially incercepted
thus need encryption of packets
list traditional encryption methods
caesar
substitution
vignere
caesar cipher
pick a number X
shift alphabet + or - X places
eg shift +4 –> ABC turns into EFG
XYZ wraps around –> BCD
write out message –> rewrite with shifted alphabet
eg twinky –> xamroc
substitution cipher
randomly rearrange alphabet
ABCDEFG –> SIERMD
spell message using rearranged alphabet
similar to caesar cipher except using random rearrangement instead of shifting letters
vignere cipher
pick a keyword –> repeat it
eg KEYKEYKEYKEY
take message and keyword –> convert letters to numeric postions
hello –> 7 4 11 11 14
keyke –> 10 4 24 10 4
add letters in the same position. If over 26 –> keep teh remainder –> obtain encrypted message
h + k –> 17
e + e –> 8
l + y –> 35 –> 9
l + k –> 21
o + e –> 18
Convert encryption numbers back to letters
17, 8, 9, 21, 18 –> RIJVS
Vignere cipher in a nutshell
Advanced caesar cipher, encryption letter shift is based on a keyword
decryption requires knowing keyword + context of what the message should be –> difficult to maliciously decrypt
importance of enigma machine
highly complex mechanical vignere cipher machine –> SUPER complex
required early computers to decode due to amount of brute force required to break
Caused teh rise of modern computing logic
code cracked by Alan Turing –> gay man punished –> suicide despite immense contributions to war effort
importance of 1-way fxns for modern encryption - why? examples
easy to perform (encrypt)
difficult to reverse (decrypt) without partial knowledge of the original process
prime factorization
hash fxn
MD5
Modulo exponentiation
prime factorization
take 2 prime numbers –> obtain result
practically impossible to reverse
modulo exponentiation
written as A^B mod M
interpretted as (A^B)/M = whole# remainder
can be efficiently calculated as
(((A mod M)A mod M)A*mod M) –> recursively * A mod M by B times
^example for A^3 mod M
hash functions + examples
use series of complex 1-way fxns to convert text to binary and then sum them –> becomes extremely difficult to decrypt/brute force due to overlap of several fxns
eg MD5 –> convert text to 128 binary string hex code only 16 bytes large
eg ASCII characters stored as 1 byte each –> 8th bit checksum uses hash fxns to check for data corruption
significance of MD5 encryption
any change to original message (capitalization, change of a single character, etc) results in completely different MD5 code
therefore sender + receiver both know what first/last few digits should be
if received message does not match expected –> message was tampered or corrupted
AES - define + how does it work
adv encryption standard
both sender/reciever know a key (secret bit sequence)
message is encrypted using the key –> key is encrypted –> redo encryption cycle for 10 times total
standard, known, encryption method –> requires extreme brute force effort to crack/reverse
AES - how do you securely share the key sequence?
public info = random prime # + a base# (for exponentiation)
sender/reciever generate their own private # (random) –> A for sender, B for reciever –> serve as indiv private key#s
Both parties calculate (base)^(pvt#) mod prime –> their own public key #s –> exchange public keys
using other’s public key + own pvt key –> public^pvt mod P = shared secret# (S)
Both parties should have calculated the same number (S) –> this will be used as the key bit sequence for further AES encryption
AES - real-time checking identities/distinguish imposters?
Use unique public/pvt keys –> if encrypt w/pvt key, only the matching public key will decrypt (and vice versa)
sender transmits message + signature (hashed message thats been encrypted with pvt key)
recipient decrypts signature with public key –> obtain hash
using the same hash algo –> MD5 the text message
if new hash matches the decrypted signature hash –> verifies identity of sender