1. Home
  2. Explore
  3. Computer Science
  4. Cryptography Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Cryptography Fundamentals

  • 32Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Cryptography Basics

What does the word 'cryptography' mean in Greek?

32 questions

  1. 1

    What does the word 'cryptography' mean in Greek?

    1. A

      Secret communication

    2. B

      Hidden writing

    3. C

      Secure coding

    4. D

      Mathematical encryption

    Correct answer
    B

    Hidden writing

    Explanation

    The speaker states that 'crypto in Greek means hidden', making 'hidden writing' the correct meaning.

  2. 2

    The Node.js crypto module is built on top of which library?

    1. A

      Libgcrypt

    2. B

      NSS

    3. C

      GnuTLS

    4. D

      OpenSSL

    Correct answer
    D

    OpenSSL

    Explanation

    The speaker mentions that the crypto module is 'a JavaScript wrapper on top of op SSL' (OpenSSL).

  3. 3

    Which of the following is true about the Node.js crypto module?

    1. A

      It is a third-party package that must be installed via npm

    2. B

      It only supports symmetric encryption algorithms

    3. C

      It is a built-in module that requires no installation

    4. D

      It is deprecated in favor of the Web Crypto API

    Correct answer
    C

    It 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'.

  4. 4

    What is the primary purpose of encryption?

    1. A

      To allow two parties to communicate over an insecure channel

    2. B

      To compress data for faster transmission

    3. C

      To authenticate the sender of a message

    4. D

      To generate random numbers for security

    Correct answer
    A

    To allow two parties to communicate over an insecure channel

    Explanation

    The speaker defines encryption as 'what lets two parties communicate over an insecure Channel'.

  5. 5

    In symmetric encryption, Alice and Bob must share:

    1. A

      A digital certificate

    2. B

      A single shared key

    3. C

      A pair of public and private keys

    4. D

      A password and salt

    Correct answer
    B

    A 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.

  6. 6

    What does the initialization vector (IV) do in symmetric encryption?

    1. A

      It signs the ciphertext to prove authenticity

    2. B

      It ensures that encrypting the same plaintext with the same key produces different ciphertexts

    3. C

      It increases the size of the key to 256 bits

    4. D

      It is used to derive the shared key from a password

    Correct answer
    B

    It 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'.

  7. 7

    What does AES-256-CBC stand for?

    1. A

      Asymmetric Encryption Standard with 256-bit key in Cipher Block Chaining mode

    2. B

      Automated Encryption System with 256-character key in Code Block Cipher mode

    3. C

      Advanced Encryption Standard with 256-byte key in Cyclic Block Cipher mode

    4. D

      Advanced Encryption Standard with 256-bit key in Cipher Block Chaining mode

    Correct answer
    D

    Advanced 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'.

  8. 8

    In the createCipheriv function, what parameters are passed?

    1. A

      The algorithm, the ciphertext, and the IV

    2. B

      The algorithm, the plaintext, and the key

    3. C

      The algorithm, the key, and the IV

    4. D

      The key, the IV, and the plaintext

    Correct answer
    C

    The 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'.

  9. 9

    Why should a password not be used directly as an encryption key?

    1. A

      Because passwords expire and need to be renewed

    2. B

      Because passwords are too long and slow down encryption

    3. C

      Because the crypto module does not accept strings as keys

    4. D

      Because passwords are too easy for attackers to guess via brute force

    Correct answer
    D

    Because 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.

  10. 10

    What is the purpose of a key derivation function (KDF)?

    1. A

      To generate random keys for encryption

    2. B

      To verify the integrity of encrypted data

    3. C

      To derive a strong, long key from a weak input like a password

    4. D

      To encrypt data using a derived key

    Correct answer
    C

    To 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'.

  11. 11

    Why are KDFs intentionally designed to be slow and memory-heavy?

    1. A

      To consume more resources so attackers cannot run them

    2. B

      To ensure compatibility with older hardware

    3. C

      To reduce the speed of encryption for security

    4. D

      To make brute-force attacks against common passwords computationally expensive

    Correct answer
    D

    To 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'.

  12. 12

    What additional parameter in a KDF prevents precomputation attacks?

    1. A

      Nonce

    2. B

      IV

    3. C

      Hash

    4. D

      Salt

    Correct answer
    D

    Salt

    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.

  13. 13

    Which of the following is a KDF built into the Node.js crypto module?

    1. A

      SHA-256

    2. B

      argon2

    3. C

      scrypt

    4. D

      bcrypt

    Correct answer
    C

    scrypt

    Explanation

    The speaker mentions 'scrypt or secure Crypt' as a built-in KDF, along with 'hkdf and pbk df2'.

  14. 14

    Why should you not use Math.random() for cryptographic purposes?

    1. A

      It is slower than the crypto module's random functions

    2. B

      It is deprecated in modern JavaScript

    3. C

      It is not cryptographically secure and can be predicted by attackers

    4. D

      It returns only integers, not buffers

    Correct answer
    C

    It 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.

  15. 15

    Which function is used to generate a buffer of random bytes in the crypto module?

    1. A

      crypto.randomUUID

    2. B

      crypto.randomFill

    3. C

      crypto.randomBytes

    4. D

      crypto.randomInt

    Correct answer
    C

    crypto.randomBytes

    Explanation

    The speaker shows randomBytes being used to generate the IV and salt, and describes it as returning 'a new buffer of that size with random values inside'.

  16. 16

    The key distribution problem refers to:

    1. A

      The need to generate a separate key for each message

    2. B

      The problem of storing keys safely on a server

    3. C

      The challenge of creating strong random keys

    4. D

      The difficulty of securely sharing a symmetric key between two parties over an insecure channel

    Correct answer
    D

    The 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.

  17. 17

    What did the Diffie–Hellman key exchange achieve?

    1. A

      It enabled encryption without any keys

    2. B

      It allowed two parties to generate a shared secret key while communicating over an insecure channel

    3. C

      It created a method for digital signatures

    4. D

      It solved the problem of certificate verification

    Correct answer
    B

    It 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.

  18. 18

    In Diffie–Hellman, what values are sent publicly over the channel?

    1. A

      The prime and the private keys

    2. B

      The private keys and the shared secret

    3. C

      The prime, generator, and each party's public key

    4. D

      Only the generator and the shared secret

    Correct answer
    C

    The 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.

  19. 19

    What is the main advantage of RSA over Diffie–Hellman?

    1. A

      It uses smaller key sizes for the same security level

    2. B

      No need for a key exchange; Bob's public key can be shared openly

    3. C

      It provides both encryption and digital signatures in one algorithm

    4. D

      It is faster for encrypting large amounts of data

    Correct answer
    B

    No 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.

  20. 20

    In RSA, which key is used for encryption?

    1. A

      The sender's public key

    2. B

      The recipient's public key

    3. C

      The recipient's private key

    4. D

      A shared symmetric key

    Correct answer
    B

    The recipient's public key

    Explanation

    The speaker says Alice 'takes Bob's public key the plain text message...she can derive the cipher text'.

  21. 21

    In the Node.js crypto module, which function is used to encrypt data with an RSA public key?

    1. A

      crypto.rsaEncrypt

    2. B

      crypto.publicEncrypt

    3. C

      crypto.encrypt

    4. D

      crypto.encryptWithPublicKey

    Correct answer
    B

    crypto.publicEncrypt

    Explanation

    The speaker shows code where Alice calls public encrypt to get the ciphertext.

  22. 22

    What is the purpose of signing a message?

    1. A

      To compress the message for faster transmission

    2. B

      To add a timestamp to prevent replay attacks

    3. C

      To prove that the message originated from a specific sender

    4. D

      To encrypt the message so that only the recipient can read it

    Correct answer
    C

    To 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'.

  23. 23

    In digital signing, which key is used to create the signature?

    1. A

      The sender's public key

    2. B

      The sender's private key

    3. C

      The recipient's private key

    4. D

      A shared symmetric key

    Correct answer
    B

    The sender's private key

    Explanation

    The speaker states that Alice 'takes her private key and the message and she creates a signature'.

  24. 24

    To verify a digital signature, which keys are needed?

    1. A

      The sender's private key and the signature

    2. B

      A shared symmetric key and the signature

    3. C

      The sender's public key and the message

    4. D

      The recipient's public key and the message

    Correct answer
    C

    The sender's public key and the message

    Explanation

    The speaker says Bob takes 'Alice's public key the message and the signature' to verify.

  25. 25

    What does HMAC stand for?

    1. A

      High-speed Message Authentication Code

    2. B

      Hybrid Message Authentication Code

    3. C

      Hashed Message Authorization Code

    4. D

      Hash-based Message Authentication Code

    Correct answer
    D

    Hash-based Message Authentication Code

    Explanation

    The speaker mentions 'create hmac which stands for a hash based message authentication code'.

  26. 26

    HMAC is used in which type of cryptography?

    1. A

      Elliptic curve cryptography

    2. B

      Quantum cryptography

    3. C

      Symmetric cryptography

    4. D

      Asymmetric cryptography

    Correct answer
    C

    Symmetric cryptography

    Explanation

    The speaker says HMAC 'goes to the world of...symmetric cryptography when we don't have a different Keys'.

  27. 27

    What is the main problem that digital certificates solve?

    1. A

      Generating random numbers for key derivation

    2. B

      Encrypting data without needing a shared key

    3. C

      Proving that a public key truly belongs to a specific entity

    4. D

      Preventing replay attacks on encrypted messages

    Correct answer
    C

    Proving 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'.

  28. 28

    What are the four parts of a digital certificate?

    1. A

      Common name, organization, country, and email

    2. B

      Hash, algorithm, timestamp, and nonce

    3. C

      Subject, claim, issuer, and signature

    4. D

      Public key, private key, salt, and IV

    Correct answer
    C

    Subject, 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'.

  29. 29

    What is a Certificate Signing Request (CSR) used for?

    1. A

      To request a certificate authority to sign a public key and associated metadata

    2. B

      To sign a message with a private key

    3. C

      To generate a new key pair

    4. D

      To encrypt a certificate for secure transmission

    Correct answer
    A

    To 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.

  30. 30

    How is trust established in a certificate chain?

    1. A

      By comparing the public key with a known hash

    2. B

      By verifying the signature using the sender's private key

    3. C

      By verifying each certificate up to a root certificate that is inherently trusted

    4. D

      By using a single trusted third party for all verifications

    Correct answer
    C

    By 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'.

  31. 31

    In the talk's example, what did the COVID vaccination QR code contain?

    1. A

      An encrypted message that required a government app to decrypt

    2. B

      A plaintext JSON with name, vaccine details, and a digital signature

    3. C

      A simple text string with no security features

    4. D

      A link to a government website to verify vaccination status

    Correct answer
    B

    A 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'.

  32. 32

    What is the Web Crypto API?

    1. A

      A JavaScript library for hashing passwords

    2. B

      A Node.js module for web-based cryptography

    3. C

      A protocol for secure web communication

    4. D

      A browser API that provides cryptographic functions similar to Node.js crypto

    Correct answer
    D

    A 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'.

Question 1 of 32
Question 1 of 32

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent