Concepts | Concept Map
- Difference between encoding, encryption, and hashing
- Encryption
- Hash functions & Cryptographic Hash Functions
- What Ethereum uses: Keccak-256
- Properties of CHF
- Determinism
- Irreversibility
- Collision prevention
- Verifiable
- A change to the message should change the hash out immensely (what’s a good “one-worder” for that)
- Because of above properties, CHFs are good for
- Proof of work
- Data fingerprinting
- Authentication
- Message integrity
- Public Keys
- Elliptic Curve Cryptography
- Private keys
Encoding vs. Encryption vs. Hashing
Encoding [Data Usability] (ASCII, Unicode, Base64, URL Encoding)
- The purpose of encoding is to transform data so that it can properly (and safely) consumed by a different type of system. For example, if we need to view special characters on a web page or data being sent over email. The goal is not to keep information secret, but rather to ensure that it's able to be properly consumed. Encoding transforms data into another format using a scheme that is publicly available so that it can be easily reversed. It does not require a key. The only thing required to decode it is the algorithm that was used to encode it
Encryption [Data Confidentiality]
- The purpose of encryption is to transform data in order to keep it secret from others. Example is if you want to send someone a secret letter that only they should be able to read, or securely sending a password over the Internet. Rather than focus on usability, the goal is to ensure the data cannot be consumed by anyone other than the intended recipients. Encryption transforms data into another format in such a way that only specific individual(s) can reverse that information. It uses a key, which is kept secret, in conjunction with the plaintext, and the algorithm, in order to perform the encryption operation. The ciphertext (encrypted text transformed from plaintext using the encryption algorithm), algorithm, and key are all required to return to plaintext
- Symmetric
- Data is encrypted and decrypted using a single, secret cryptographic key
- Using stream cipher or block cipher to encrypt and decrypt data
- Senders and recipients must know the secret to, in the case of senders, encrypt the data they intend to share with recipients, and in the case of recipients, decrypt and read the encrypted data the senders share with them as well as encrypt any responses
- Examples:
- Data Encryption Standard (DES)
- Triple Data Encryption Standard (Triple DES)
- Advanced Encryption Standard (AES)
- International Data Encryption Algorithm (IDEA)
- TLS/SSL Protocol
- Asymmetric
- AKA: Public key-cryptography
- Uses mathematically linked public-and private-key pairs to encrypt and decrypt senders’ and recipients’ sensitive data
Hashing [Data Integrity]
- The purpose of hashing is to ensure integrity making it so that if something has changed, you can know that it has changed. Hashing takes in an input, and produces a fixed-length string that:
- The same input will always produce the same output
- Multiple different inputs should not produce the same out (more on this on Thursday)
- It should not be possible to go from output to input
- Any modification of a given input should result in a drastic change to the hash
Lab Ideas
- Simple online demos of CHF
- Making a basic hash function?
- Link to open source libraries