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

  • 47Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Cryptography Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • β†’Next card

What does the word 'crypto' mean in Greek?

Tap to flipClick to flipspace

Hidden

Or swipe the card

47 cards

  1. What does the word 'crypto' mean in Greek?

    Hidden

  2. What is the definition of cryptography?

    The study (or science) of techniques of secret communication or secret writing.

  3. What is the Node.js crypto module based on?

    OpenSSL – it is a JavaScript wrapper on top of OpenSSL.

  4. What are the two main types of encryption discussed?

    Symmetric encryption (shared key) and asymmetric encryption (public/private key pair).

  5. In cryptographic examples, what do the names Alice, Bob, and Eve represent?

    Alice and Bob are two parties trying to communicate securely; Eve is an eavesdropper or malicious actor.

  6. What is the purpose of encryption?

    To allow two parties to communicate over an insecure channel without worrying about an eavesdropper understanding the original message.

  7. What are the three inputs to a symmetric encryption algorithm?

    Plaintext, key, and (optionally) an initialization vector (IV).

  8. What is ciphertext?

    The encrypted output that looks meaningless without the key.

  9. What does AES stand for and what kind of algorithm is it?

    Advanced Encryption Standard; it is a symmetric encryption standard widely used today.

  10. What does 'AES-256-CBC' refer to?

    AES with a 256-bit key (AES-256) and Cipher Block Chaining (CBC) mode.

  11. Why is an initialization vector (IV) used in CBC mode?

    To ensure that encrypting the same plaintext with the same key produces different ciphertext each time, preventing pattern analysis.

  12. In Node.js crypto, how is an IV generated?

    Using crypto.randomBytes(size) to get a buffer of random bytes.

  13. What Node.js function returns a list of supported cipher algorithms?

    crypto.getCiphers()

  14. How does Alice encrypt a message using Node.js crypto with AES-256-CBC?

    She creates a cipher object using crypto.createCipheriv(algorithm, key, iv), calls cipher.update(plaintextBuffer), then cipher.final() to get the ciphertext.

  15. What is the Node.js function to decrypt with a symmetric algorithm?

    crypto.createDecipheriv(algorithm, key, iv)

  16. Why should a human-memorable password not be used directly as a symmetric key?

    Because passwords have low entropy, making them vulnerable to brute-force attacks; attackers can guess common passwords.

  17. What is a Key Derivation Function (KDF)?

    A function that derives a strong, long key from a weaker input such as a password.

  18. What is a notable property of a KDF?

    It is designed to be slow (CPU-heavy and memory-heavy) on purpose.

  19. What is a 'salt' in the context of KDFs?

    A random value used as an additional input to the KDF, unique per derivation.

  20. Name three KDFs available in Node.js crypto.

    scrypt (secure crypt), HKDF, and PBKDF2.

  21. How is scrypt used in Node.js?

    crypto.scrypt(password, salt, keylen, callback) or its synchronous counterpart; it returns the derived key.

  22. Why should Math.random() not be used for cryptographic purposes?

    It is not cryptographically secure; its output can be predicted by an attacker.

  23. What functions in Node.js crypto generate cryptographically secure random values?

    crypto.randomBytes(size), crypto.randomFill(buffer), crypto.randomInt(min, max), and crypto.randomUUID().

  24. What is the key distribution problem?

    The challenge of securely sharing a symmetric key between two parties who cannot meet offline.

  25. What is the Diffie-Hellman key exchange?

    A method that allows two parties to generate a shared secret key over an insecure channel, without pre-sharing a key.

  26. What are the steps of Diffie-Hellman key exchange?

    1. Alice chooses a prime, generator, and her private key; computes her public key and sends it to Bob. 2. Bob uses the same prime and generator with his private key to compute his public key; sends it to Alice. 3. Both compute the shared key using the other's public key.
  27. What is the Node.js API for Diffie-Hellman key exchange?

    crypto.createDiffieHellman(primeLength) or crypto.createDiffieHellman(prime, generator); then use dh.generateKeys(), dh.getPublicKey(), dh.getPrivateKey(), and dh.computeSecret(otherPublicKey).

  28. What is a disadvantage of Diffie-Hellman key exchange?

    It requires a separate key exchange with each party you want to communicate with, making it cumbersome for many parties.

  29. What is RSA?

    An asymmetric encryption algorithm that uses a public/private key pair; named after its inventors Rivest, Shamir, and Adleman.

  30. In RSA, which key is used for encryption and which for decryption?

    Encryption uses the public key; decryption uses the private key.

  31. How does Bob generate an RSA key pair in Node.js?

    Using crypto.generateKeyPair('rsa', options, callback) with options like modulusLength; it provides publicKey and privateKey.

  32. How does Alice encrypt a message with Bob's RSA public key?

    Using crypto.publicEncrypt(publicKey, buffer) with optional padding.

  33. How does Bob decrypt an RSA-encrypted message?

    Using crypto.privateDecrypt(privateKey, buffer) with the same padding configuration.

  34. What recent concern has been raised about RSA?

    Quantum computers can potentially break RSA encryption; it is showing its age.

  35. What is signing in cryptography?

    Creating a digital signature with a private key to prove that a message came from the claimed sender and has not been altered.

  36. How does Alice sign a message in Node.js?

    Using crypto.sign(algorithm, data, privateKey), where algorithm is the hash function (e.g., 'SHA256').

  37. How does Bob verify a signature from Alice?

    Using crypto.verify(algorithm, data, publicKey, signature) which returns true or false.

  38. What does HMAC stand for?

    Hash-based Message Authentication Code.

  39. What problem does signing alone not solve?

    It does not prove that a public key truly belongs to a specific identity (e.g., Alice); an attacker could claim to be Alice and post a different public key.

  40. What is a digital certificate?

    A document that binds a public key to an entity (subject) and is signed by a trusted issuer (CA).

  41. What are the four components of a certificate?

    1. Subject (who it is issued to) 2. Claim/property (e.g., public key) 3. Issuer (who issued it) 4. Signature (by issuer).
  42. What is a Certificate Signing Request (CSR)?

    A message sent from an applicant to a certificate authority (CA) to request a certificate; it contains the public key and subject info, to be signed by the CA.

  43. How does Bob verify Alice's certificate using Carol's certificate?

    Bob reads Carol's certificate to get Carol's public key, then uses that key to verify the signature on Alice's certificate.

  44. What is a certificate chain (or hierarchy)?

    A chain of certificates where each certificate is signed by the next one up to a root certificate that is inherently trusted.

  45. How do you read a certificate in Node.js?

    Using new crypto.X509Certificate(certBuffer) to parse a PEM or DER certificate.

  46. What property on an X509Certificate gives the common name (CN) of the subject?

    certificate.subject (e.g., 'CN=Alice'), or via .subject string containing the distinguished name.

  47. What is the Web Crypto API?

    A browser-based API for performing cryptographic operations in JavaScript, similar to Node.js crypto but with different interfaces.

Card 1 of 47
Card 1 of 47

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent