Cryptography Fundamentals Questions

Core concepts and vocabulary of cryptography: confidentiality, integrity, authentication, and non-repudiation; the difference between symmetric and asymmetric primitives; and how standard algorithms, libraries, and protocols fit together. Covers threat models, common standards, and applying primitives and cryptographic libraries correctly to real-world security problems. The entry point for the cryptography track.

EasyTechnical
87 practiced

Define initialization vector (IV) and nonce as used in block/stream cipher modes. What properties must each satisfy (randomness vs uniqueness), and what happens in practice if a nonce is reused with a mode like GCM?

MediumTechnical
145 practiced

Write a function that compares two byte strings for equality in constant time, suitable for verifying a MAC (e.g. an HMAC tag) without using a language's built-in constant-time-compare helper. Explain specifically why your implementation doesn't leak timing information, and how you'd test that claim.

MediumTechnical
89 practiced

Explain key derivation functions (KDFs) such as PBKDF2 and HKDF. Describe appropriate use cases for each (password stretching vs deriving multiple keys), the roles of salt and iteration/memory cost, and how to safely derive multiple cryptographic keys from a single secret.

EasyTechnical
99 practiced

Explain the core security properties a cryptographic hash function must have (preimage resistance, second-preimage resistance, collision resistance), name a couple of common algorithms, and give one example each of where a hash is the right tool (integrity checks, content-addressing) and where it is not (storing passwords without salting and stretching).

MediumTechnical
72 practiced

In Python 3 using the 'cryptography' library, you find code that encrypts data using AES in ECB mode. Rewrite the encryption and decryption flow to use AES-GCM properly, showing secure key generation, nonce selection, encryption with associated data, and authentication tag verification. Explain how you persist nonce and tag alongside ciphertext.

Unlock Full Question Bank

Get access to all 37 Cryptography Fundamentals interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.