Cryptography Fundamentals
- 32Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What does the word 'cryptography' mean in Greek?
What does the word 'cryptography' mean in Greek?
32 questions
- 1
What does the word 'cryptography' mean in Greek?
- A
Secret communication
- B
Hidden writing
- C
Secure coding
- D
Mathematical encryption
Correct answer
BHidden writing
Explanation
The speaker states that 'crypto in Greek means hidden', making 'hidden writing' the correct meaning.
- A
- 2
The Node.js crypto module is built on top of which library?
- A
Libgcrypt
- B
NSS
- C
GnuTLS
- D
OpenSSL
Correct answer
DOpenSSL
Explanation
The speaker mentions that the crypto module is 'a JavaScript wrapper on top of op SSL' (OpenSSL).
- A
- 3
Which of the following is true about the Node.js crypto module?
- A
It is a third-party package that must be installed via npm
- B
It only supports symmetric encryption algorithms
- C
It is a built-in module that requires no installation
- D
It is deprecated in favor of the Web Crypto API
Correct answer
CIt is a built-in module that requires no installation
Explanation
The speaker emphasizes that crypto is 'one of the built-in libraries' and 'you can just get started using it right away no need to install anything'.
- A
- 4
What is the primary purpose of encryption?
- A
To allow two parties to communicate over an insecure channel
- B
To compress data for faster transmission
- C
To authenticate the sender of a message
- D
To generate random numbers for security
Correct answer
ATo allow two parties to communicate over an insecure channel
Explanation
The speaker defines encryption as 'what lets two parties communicate over an insecure Channel'.
- A
- 5
In symmetric encryption, Alice and Bob must share:
- A
A digital certificate
- B
A single shared key
- C
A pair of public and private keys
- D
A password and salt
Correct answer
BA single shared key
Explanation
The speaker explains that for the first type of encryption, Alice and Bob need 'a shared key' that they both know.
- A
- 6
What does the initialization vector (IV) do in symmetric encryption?
- A
It signs the ciphertext to prove authenticity
- B
It ensures that encrypting the same plaintext with the same key produces different ciphertexts
- C
It increases the size of the key to 256 bits
- D
It is used to derive the shared key from a password
Correct answer
BIt ensures that encrypting the same plaintext with the same key produces different ciphertexts
Explanation
The speaker explains that using a random IV means 'even if every morning...she sends Bob the same message...she will still use a different IV value...the resulting Cipher text will be different'.
- A
- 7
What does AES-256-CBC stand for?
- A
Asymmetric Encryption Standard with 256-bit key in Cipher Block Chaining mode
- B
Automated Encryption System with 256-character key in Code Block Cipher mode
- C
Advanced Encryption Standard with 256-byte key in Cyclic Block Cipher mode
- D
Advanced Encryption Standard with 256-bit key in Cipher Block Chaining mode
Correct answer
DAdvanced Encryption Standard with 256-bit key in Cipher Block Chaining mode
Explanation
The speaker explains AES is 'Advanced encryption standard', 256 is the key size in bits, and CBC stands for 'Cipher block chaining'.
- A
- 8
In the
createCipherivfunction, what parameters are passed?- A
The algorithm, the ciphertext, and the IV
- B
The algorithm, the plaintext, and the key
- C
The algorithm, the key, and the IV
- D
The key, the IV, and the plaintext
Correct answer
CThe algorithm, the key, and the IV
Explanation
The speaker shows code where Alice 'creates a cipher object using Create Cipher IV passing in the algorithm the key and the IV'.
- A
- 9
Why should a password not be used directly as an encryption key?
- A
Because passwords expire and need to be renewed
- B
Because passwords are too long and slow down encryption
- C
Because the crypto module does not accept strings as keys
- D
Because passwords are too easy for attackers to guess via brute force
Correct answer
DBecause passwords are too easy for attackers to guess via brute force
Explanation
The speaker warns that using a human memorable password as the key allows Eve to 'try a much narrower set' of options, making brute force feasible.
- A
- 10
What is the purpose of a key derivation function (KDF)?
- A
To generate random keys for encryption
- B
To verify the integrity of encrypted data
- C
To derive a strong, long key from a weak input like a password
- D
To encrypt data using a derived key
Correct answer
CTo derive a strong, long key from a weak input like a password
Explanation
The speaker defines KDF as 'something that lets us derive a strong Long Key from something else for example a password'.
- A
- 11
Why are KDFs intentionally designed to be slow and memory-heavy?
- A
To consume more resources so attackers cannot run them
- B
To ensure compatibility with older hardware
- C
To reduce the speed of encryption for security
- D
To make brute-force attacks against common passwords computationally expensive
Correct answer
DTo make brute-force attacks against common passwords computationally expensive
Explanation
The speaker explains that making KDFs slow 'so that if Eve is trying to take...a list of common passwords...it will be very slow for her to do and make it not worth her while'.
- A
- 12
What additional parameter in a KDF prevents precomputation attacks?
- A
Nonce
- B
IV
- C
Hash
- D
Salt
Correct answer
DSalt
Explanation
The speaker states that 'in real kdf's we have another crucial parameter which is called the salt' and it prevents Eve from using precomputed lists.
- A
- 13
Which of the following is a KDF built into the Node.js crypto module?
- A
SHA-256
- B
argon2
- C
scrypt
- D
bcrypt
Correct answer
Cscrypt
Explanation
The speaker mentions 'scrypt or secure Crypt' as a built-in KDF, along with 'hkdf and pbk df2'.
- A
- 14
Why should you not use
Math.random()for cryptographic purposes?- A
It is slower than the crypto module's random functions
- B
It is deprecated in modern JavaScript
- C
It is not cryptographically secure and can be predicted by attackers
- D
It returns only integers, not buffers
Correct answer
CIt is not cryptographically secure and can be predicted by attackers
Explanation
The speaker quotes MDN: 'it is not considered cryptographically secure' meaning an attacker can guess or influence the output.
- A
- 15
Which function is used to generate a buffer of random bytes in the crypto module?
- A
crypto.randomUUID
- B
crypto.randomFill
- C
crypto.randomBytes
- D
crypto.randomInt
Correct answer
Ccrypto.randomBytes
Explanation
The speaker shows
randomBytesbeing used to generate the IV and salt, and describes it as returning 'a new buffer of that size with random values inside'. - A
- 16
The key distribution problem refers to:
- A
The need to generate a separate key for each message
- B
The problem of storing keys safely on a server
- C
The challenge of creating strong random keys
- D
The difficulty of securely sharing a symmetric key between two parties over an insecure channel
Correct answer
DThe difficulty of securely sharing a symmetric key between two parties over an insecure channel
Explanation
The speaker introduces the 'key distribution problem' as the challenge of having a shared key when computers cannot meet offline.
- A
- 17
What did the Diffie–Hellman key exchange achieve?
- A
It enabled encryption without any keys
- B
It allowed two parties to generate a shared secret key while communicating over an insecure channel
- C
It created a method for digital signatures
- D
It solved the problem of certificate verification
Correct answer
BIt allowed two parties to generate a shared secret key while communicating over an insecure channel
Explanation
The speaker explains that Diffie-Hellman allows Alice and Bob to 'generate a shared key...even though they're communicating over an insecure Channel' and Eve cannot compute it.
- A
- 18
In Diffie–Hellman, what values are sent publicly over the channel?
- A
The prime and the private keys
- B
The private keys and the shared secret
- C
The prime, generator, and each party's public key
- D
Only the generator and the shared secret
Correct answer
CThe prime, generator, and each party's public key
Explanation
The speaker describes that Alice sends her public key, prime, and generator to Bob, and Bob sends his public key back.
- A
- 19
What is the main advantage of RSA over Diffie–Hellman?
- A
It uses smaller key sizes for the same security level
- B
No need for a key exchange; Bob's public key can be shared openly
- C
It provides both encryption and digital signatures in one algorithm
- D
It is faster for encrypting large amounts of data
Correct answer
BNo need for a key exchange; Bob's public key can be shared openly
Explanation
The speaker states that with RSA, 'now really there's no need to do any key exchange' because Bob makes his public key known to everyone.
- A
- 20
In RSA, which key is used for encryption?
- A
The sender's public key
- B
The recipient's public key
- C
The recipient's private key
- D
A shared symmetric key
Correct answer
BThe recipient's public key
Explanation
The speaker says Alice 'takes Bob's public key the plain text message...she can derive the cipher text'.
- A
- 21
In the Node.js crypto module, which function is used to encrypt data with an RSA public key?
- A
crypto.rsaEncrypt
- B
crypto.publicEncrypt
- C
crypto.encrypt
- D
crypto.encryptWithPublicKey
Correct answer
Bcrypto.publicEncrypt
Explanation
The speaker shows code where Alice calls
public encryptto get the ciphertext. - A
- 22
What is the purpose of signing a message?
- A
To compress the message for faster transmission
- B
To add a timestamp to prevent replay attacks
- C
To prove that the message originated from a specific sender
- D
To encrypt the message so that only the recipient can read it
Correct answer
CTo prove that the message originated from a specific sender
Explanation
The speaker introduces signing to 'know that the message that we got from a certain entity really came from that entity'.
- A
- 23
In digital signing, which key is used to create the signature?
- A
The sender's public key
- B
The sender's private key
- C
The recipient's private key
- D
A shared symmetric key
Correct answer
BThe sender's private key
Explanation
The speaker states that Alice 'takes her private key and the message and she creates a signature'.
- A
- 24
To verify a digital signature, which keys are needed?
- A
The sender's private key and the signature
- B
A shared symmetric key and the signature
- C
The sender's public key and the message
- D
The recipient's public key and the message
Correct answer
CThe sender's public key and the message
Explanation
The speaker says Bob takes 'Alice's public key the message and the signature' to verify.
- A
- 25
What does HMAC stand for?
- A
High-speed Message Authentication Code
- B
Hybrid Message Authentication Code
- C
Hashed Message Authorization Code
- D
Hash-based Message Authentication Code
Correct answer
DHash-based Message Authentication Code
Explanation
The speaker mentions 'create hmac which stands for a hash based message authentication code'.
- A
- 26
HMAC is used in which type of cryptography?
- A
Elliptic curve cryptography
- B
Quantum cryptography
- C
Symmetric cryptography
- D
Asymmetric cryptography
Correct answer
CSymmetric cryptography
Explanation
The speaker says HMAC 'goes to the world of...symmetric cryptography when we don't have a different Keys'.
- A
- 27
What is the main problem that digital certificates solve?
- A
Generating random numbers for key derivation
- B
Encrypting data without needing a shared key
- C
Proving that a public key truly belongs to a specific entity
- D
Preventing replay attacks on encrypted messages
Correct answer
CProving that a public key truly belongs to a specific entity
Explanation
The speaker introduces certificates to answer 'how do we know that a specific publicy really does belong to a certain person or entity'.
- A
- 28
What are the four parts of a digital certificate?
- A
Common name, organization, country, and email
- B
Hash, algorithm, timestamp, and nonce
- C
Subject, claim, issuer, and signature
- D
Public key, private key, salt, and IV
Correct answer
CSubject, claim, issuer, and signature
Explanation
The speaker lists: 'who is it for, what does it say about that person, who is the person giving that...the issuer, and we have the signature'.
- A
- 29
What is a Certificate Signing Request (CSR) used for?
- A
To request a certificate authority to sign a public key and associated metadata
- B
To sign a message with a private key
- C
To generate a new key pair
- D
To encrypt a certificate for secure transmission
Correct answer
ATo request a certificate authority to sign a public key and associated metadata
Explanation
Alice creates a CSR containing her public key and metadata, which is then signed by Carol.
- A
- 30
How is trust established in a certificate chain?
- A
By comparing the public key with a known hash
- B
By verifying the signature using the sender's private key
- C
By verifying each certificate up to a root certificate that is inherently trusted
- D
By using a single trusted third party for all verifications
Correct answer
CBy verifying each certificate up to a root certificate that is inherently trusted
Explanation
The speaker explains the certificate chain: 'at the very top you reach...your root certificate which is a certificate that you just have to trust because it's baked into your operating system'.
- A
- 31
In the talk's example, what did the COVID vaccination QR code contain?
- A
An encrypted message that required a government app to decrypt
- B
A plaintext JSON with name, vaccine details, and a digital signature
- C
A simple text string with no security features
- D
A link to a government website to verify vaccination status
Correct answer
BA plaintext JSON with name, vaccine details, and a digital signature
Explanation
The speaker says the QR code contained 'a plain text um Json value which has your name what vaccine you got and when you got it and a signature'.
- A
- 32
What is the Web Crypto API?
- A
A JavaScript library for hashing passwords
- B
A Node.js module for web-based cryptography
- C
A protocol for secure web communication
- D
A browser API that provides cryptographic functions similar to Node.js crypto
Correct answer
DA browser API that provides cryptographic functions similar to Node.js crypto
Explanation
The speaker mentions 'if you're doing JavaScript but not in node.js and rather in the browser you have something which is called the web crypto API'.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.