Cryptography in Computer Science
Entropy
熵
1 | entropy = math.log(len(all_possible) , 2) |
1 | from math import log |
Hash function
1 | $ echo -n "hello" | sha1sum |
Key Derivation Functions(KDFs)
functions used to generate secret key from a human-friendly password
works like hash
slow (validation only compute once, brute force compute lots of times, so it can slow down the attacker)
Symmetric Encryption
1 | $ openssl aes-256-cbc -salt -in myfile -out myencfile |
What is salt?
against rainbowtable
1 | salt = random() |