Lesson 9: Implementing Cryptography Flashcards
What is hashing?
Function that converts an arbitrary length string input to a fixed length string output. A cryptographic hash function does this in a way that reduces the chance of collisions, where two different inputs produce the same output
List the three attributes that define hashing
The output is of fixed length, meaning the output length depends upon the hashing algorithm used.
The same input to a hashing algorithm will generate the same output every time it is hashed with the same hashing algorithm.
The output of the hashing function cannot be used to recreate the input in any way, which is referred to as being a one-way function.
What is a collision in hashing?
A collision occurs when two completely different inputs generate the same hash value.
What is another name for a hash algorithm output?
digest
message digest
condensed representation of electronic data
List the two most common hashing algorithms
Message Digest Algorithm (MD5)
Secure Hash Algorithm (SHA)
How many bits of output does MD5 produce?
128
Which hashing algorithm has a high chance of collision?
MD5
How many variants of SHA algorithm do we have?
3
SHA-1 generates 160-bit output
SHA-256 generates 256-bit output
SHA-512 generates 512-bit output
In what year were attacks against SHA-1 successful?
2005
What is HMAC?
HMAC, which stands for hash-based message authentication code, is a method used to verify both the integrity and authenticity of a message by combining a cryptographic hash of the message with a secret key.
How does the HMAC process work?
Step 1: The sender uses an HMAC function to produce a MAC by providing the MESSAGE and SECRET KEY to the hash function.
Step 2: The output is a MAC, transmitted with the message.
Step 3: The recipient can compute the MAC by providing the message and secret key as inputs to the same HMAC function the sender uses.
Step 4: If the MAC matches, then the message is intact.
What is a cipher?
A cipher is the same as an algorithm.
list the 2 categories of symmetric encryption
block cipher and stream cipher
What is block cipher?
A type of symmetric encryption that encrypts data one block at a time, often in 128-bit blocks. It is usually more secure, but is also slower, than stream ciphers.
What is stream cipher?
A type of symmetric encryption that combines a stream of plaintext bits or bytes with a pseudorandom stream initialized by a secret key.