Implementing Crytography Flashcards

1
Q

A software developer is selecting a key agreement for an organization’s authentication. Which agreement type should the developer use?

A

The developer should use Elliptic-Curve Diffie-Hellman (ECDH). The operation of ECDH is similar to standard Diffie-Helman (DH) but utilizes math based on elliptic curves instead of discrete logs (as is the case for DH).

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

Why would a developer not use DH, RSA, or DSA for authentication?

A

Diffie-Hellman (DH) by itself does not provide any authentication mechanism and cannot adequately identify if the other party is really who they claim to be without utilizing an authentication mechanism in parallel.

Rivest, Shamir, and Adleman (RSA) is for signing. RSA is a widely used asymmetric algorithm based on factoring large prime numbers.

Digital Signature Algorithm (DSA) is also for signing and operates similarly to RSA but based on logarithmic and modulus math.

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

A college developer is working on a research project and wants to start developing for bitcoin programming. Which hashing algorithm does bitcoin use?

A

Secure Hash Algorithm-256 (SHA-256) is used within the bitcoin network for proof-of-work (mining) and also in the creation of bitcoin addresses.

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

A software developer is setting up a symmetric encryption block cipher that uses an initial chaining vector for the first round of encryption. Which of the following will the software developer use?

A

Output Feedback (OFB) uses an initial chaining vector (ICV) for the first round of encryption and combines the output of all previous rounds as input for all subsequent rounds.

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

What is CBC susceptible to?

A

Cipher Block Chaining (CBC) is a very simple mode of operation. It should not be used and is susceptible to the padding-oracle attack.

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

A network technician is setting up Extensible Authentication Protocol (EAP) but wants to ensure using the most common and widely supported type. Which type should the network technician choose?

A

EAP Transport Layer Security (EAP-TLS) is one of the strongest types of authentication and is very widely supported.

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

A software developer is troubleshooting cipher issues and sees the output “ECDHE-RSA-AES128-GCM-SHA256.” Which portion is the part regarding HMAC?

A

256-bit secure hash algorithm (SHA) is the specification for HMAC functions. A hash-based message authentication code (HMAC) is a mechanism where the system can verify both the source and the content of a message without using any other means.

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

An auditor for a federal agency is reviewing encryption. Which standard is the auditor most likely using?

A

Advanced Encryption Standard (AES) is the current U.S. federal government standard for symmetric encryption that is widely supported and efficient.

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

A developer is looking for a solution that will provide confidentiality and check its integrity and authenticity for encrypted plaintext. Which solution should the developer use?

A

Authenticated Encryption with Associated Data (AEAD) is a form of encryption that, in addition to providing confidentiality for the encrypted plaintext, provides a way to check its integrity and authenticity.

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

A security professional is discussing the weaknesses of RC4. An RC4 is an example of what?

A

RC4 is an example of a stream cipher, which encrypts each digit of data in the plaintext, one at a time, using a stream of pseudorandom values. However, RC4 was originally developed in 1984 and contains multiple vulnerabilities.

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

A developer needs an authentication coding mechanism that supports older iPhone/iPad and Android devices. Which of the following would work best for the developer?

A

Poly1305 is a message authentication code (MAC) focused on speed and efficiency. It operates very well on devices that do not include advanced encryption standard (AES) hardware acceleration, such as older iPhone/iPad and Android devices.

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

A system administrator wants to send an email with an attachment through encrypted means. Which of should the sysadmin use?

A

To use Secure/Multipurpose Internet Mail Extensions (S/MIME), the user gets issued a digital certificate containing the public key, signed by a CA. The user keeps the public key and private key secret.

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

Describe MD5.

A

Message Digest Algorithm (MD5) produces a 128-bit output. Hashing is sometimes used as a method to represent passwords. Passwords should be protected with more complicated methods than simple direct hashing, and this is especially true for MD5 because it’s short outputs can be easily brute-forced. Additionally, MD5 has a high chance of collision.

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

Describe SHA.

A

Secure Hash Algorithm (SHA) has a few variants: the original SHA-1 generates 160-bit output, SHA256 (which is widely used) generates 256-bit output. Both SHA-1 and SHA-256 use internal mathematical techniques similar to MD5. SHA-256 is used within the bitcoin network for proof-of-work (mining) and also in the creation of bitcoin addresses.

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

What is SHA-3’s original name?

A

Keccack

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

What is RIPEMD?

A

The RIPEMD was developed around the same time as SHA-1. It was designed to produce longer outputs than MD5 and developed independently from the US government. RIPEMD can be used to generate outputs of 128, 160, 256, and 320 bits and is used within the PGP encryption program as well as the bitcoin standard (RIPEMD-160 is used for addresses.)

17
Q

What is HMAC?

A

A hash-based message authentication code (HMAC) is a specific implementation of a MAC. A message authentication code is a mechanism by which both the source and the content of a message can be verified without the need to use any other means. When a MAC is constructed through the use of hashing it is then an HMAC. An HMAC has two parameters: the message and a secret key known only to the message sender and receiver.

18
Q

What is Poly1305?

A

Poly1305 is a MAC focused on speed and efficiency and operates very well on devices that do not include AES hardware acceleration, such as older iPhone/iPad and Android devices. On these devices, when Poly1305 is combined with alternative encryption algorithms (such as ChaCha20 or Salsa20), it produces much faster performance than traditional algorithms. Fortunately, newer device chips such as Snapdragon and Apple Silicon include AES hardware acceleration.

19
Q

What’s a symmetric algorithm?

A

Symmetric Algorithms are used to encrypt messages or data. Symmetric encryption algorithms can be compared to a standard door lock in that they are operated using a single key. Considering a door lock as an example, the key is used to both lock and unlock the door. This makes operating the lock simple. Symmetric encryption is comparable to this in that a single key, or cryptovariable, is used to both encrypt as well as decrypt the data. Similarly, protecting the key is of paramount importance! This underpins one of the problems with using symmetric encryption as the key used for protecting data must be shared in some way without exposing the key to an adversary. This is commonly referred to as the key distribution problem.

20
Q

How many categories of symmetric encryption algorithms are there?

A

Two: stream cipher and block cipher (cipher is an alternative term for an algorithm).

21
Q

Describe a Stream Cipher.

A

In a stream cipher, each digit of data in the plaintext (input/message) is encrypted one at a time using a keystream (a stream of pseudorandom values). Stream ciphers are well-suited for encrypting communications where the total length of the message is not known. The keystream is generated through the use of an initialization vector (IV) that is combined with a static key value to generate a unique keystream. The IV is a continuously changing value to ensure that the key produces a unique ciphertext from the same plaintext. The keystream must be unique, so an IV must not be reused with the same key. The recipient must be able to generate the same keystream as the sender so the streams must be synchronized. This is accomplished by exchanging the key during the setup of a communication session or transmitted separately.

22
Q

Describe a Block Cipher.

A

In a block cipher, the plaintext is divided into equal-size blocks (typically of size 128-bit). If there is not enough data in the plaintext (meaning the data to be encrypted is smaller than the block size), the data is padded to the correct size using values defined by the algorithm. For example, a 1200-bit plaintext would be padded with an extra 80 bits to fit into the smallest possible combination of 128-bit blocks, which is 10 x 128-bit = 1280 blocks. Each block is then encrypted according to the mode of operation being used, and covered in the next topic.

23
Q

Give me some examples of Stream Ciphers.

A

RC4, Salsa20, ChaCha

24
Q

Describe ChaCha.

A

A variant of Salsa20 developed in 2008. Adopted by Google and combined with the Poly1305 MAC algorithm (ChaCha-Poly1305) and used by Google Chrome browser running on Android devices. Now more widely adopted, for example openSSH and as a random number generator in BSD operating systems. ChaCha is particularly well-suited to devices lacking AES hardware acceleration capabilities.

25
Q

Give some examples of Block Ciphers.

A

Triple Digital Encryption Standard (3DES), Advanced Encryption Standard (AES)

26
Q

What is a mode of operation?

A

Modes of operation are used with symmetric block ciphers to enable them to work on large sets of data. Modes of operation affect the level of security provided by the underlying block cipher. Modes of operations can be thought of as “techniques” or methods by which symmetric encryption can be performed in order to mimic the operation of a stream cipher, namely to process a series of blocks of data, although the amount of data is known unlike in streaming operations.

27
Q

Name some modes of operation.

A

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

28
Q

What is CBC?

A

Very simple mode. Should not be used, susceptible to the padding-oracle attack.

29
Q

What is ECB?

A

Simple mode, also should not be used and is susceptible to the padding-oracle attack.

30
Q

What is GCM?

A

Provides authenticated encryption with associated data and is widely adopted due to its performance. A specialized form of counter mode whereby the “Galois” modification provides the authentication feature.

31
Q

What is CTR?

A

Counter mode applies an IV plus an incrementing counter value to the key to generate a keystream. Counter modes do not need to use padding. Any unused space in the last block is simply discarded.

32
Q

What is OFB?

A

Uses an initial chaining vector (ICV) for the first round of encryption and combines the output of all previous rounds as input for all subsequent rounds.