Lesson 9: Implementing Cryptography Flashcards

1
Q

What is hashing?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List the three attributes that define hashing

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a collision in hashing?

A

A collision occurs when two completely different inputs generate the same hash value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is another name for a hash algorithm output?

A

digest
message digest
condensed representation of electronic data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List the two most common hashing algorithms

A

Message Digest Algorithm (MD5)
Secure Hash Algorithm (SHA)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How many bits of output does MD5 produce?

A

128

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which hashing algorithm has a high chance of collision?

A

MD5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How many variants of SHA algorithm do we have?

A

3
SHA-1 generates 160-bit output
SHA-256 generates 256-bit output
SHA-512 generates 512-bit output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In what year were attacks against SHA-1 successful?

A

2005

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is HMAC?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does the HMAC process work?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a cipher?

A

A cipher is the same as an algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

list the 2 categories of symmetric encryption

A

block cipher and stream cipher

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is block cipher?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is stream cipher?

A

A type of symmetric encryption that combines a stream of plaintext bits or bytes with a pseudorandom stream initialized by a secret key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How is the keystream in a stream cipher generated?

A

Through the use of an initialization Vector (IV)

17
Q

What is IV

A

A technique used in cryptography to generate random numbers to be used along with a secret key to provide data encryption.

18
Q

List 3 examples of stream ciphers

A

RC4, Salsa20, ChaCha

19
Q

List 2 examples of block ciphers

A

3DES, AES

20
Q

What are cipher modes of operations used for?

A

Modes of operation are used with symmetric block ciphers to enable them to work on large sets of data.

21
Q

List the various modes of operations for symmetric block ciphers

A

Cipher Block Chaining (CBC)
Electronic Codebook (ECB)
Galois/Counter Mode (GCM)
Counter (CTR)
Output Feedback (OFB)

22
Q

What is asymmetric algorithm?

A

An asymmetric algorithm is an encryption algorithm that uses the combination of a public and private key to encrypt and decrypt data.

23
Q

This type of encryption proves identity

A

Asymmetric encryption

23
Q

How are the public and private keys linked in an asymmetric encryption?

A

The keys are linked in such a way as to make it impossible to derive one from the other.

24
Q

What is asymmetric encryption mostly used for?

A

For authentication, non-repudiation, and key agreement and exchange.

25
Q

What is the difference between a key exchange and a key agreement?

A

In a key exchange, the secret or symmetric key is transmitted between parties meanwhile in a key agreement, the secret is mathematically generated by an agreed upon method.

26
Q

List and explain the types asymmetric key agreement methods

A

Diffie-Hellman (DH) –> It allows for symmetric key exchange using complicated modulus math based upon a common secret.

Elliptic-Curve Diffie-Hellman (ECDH) –> It follows the same process as DH but uses math based on elliptic curves instead of discrete logs.

27
Q

Dh is susceptible to what attack?

A

logjam attack

28
Q

True or False
Public key cryptography can only be used with very small messages.

A

True

29
Q

What is a digital signature?

A

A message digest encrypted using the sender’s private key that is appended to a message to authenticate the sender and prove message integrity.

30
Q

List the methods used in signing a message

A

Rivest, Shamir, and Adleman (RSA) –> based on factoring large prime numbers. It uses private/public key functions in conjunction with DH.

Digital Signature Algorithm (DSA) –> DSA operates similarly to RSA but is based on logarithmic and modulus math.

Elliptic-Curve Digital Signature Algorithm (ECDSA) –> ECDSA operates similarly to DSA but utilizes properties of elliptic curves in order to provide comparable levels of protection as RSA but with much smaller keys.

31
Q

What is one disadvantage of using DSA over RSA?

A

Compared to RSA, DSA is faster at generating digital signatures but slower at verifying them.

32
Q

What is a cipher suite?

A

This is the algorithm supported by both the client and server to perform the different encryption and hashing operations required by the protocol.

33
Q
A