Skip to content

cryptography

AI security interview questions tagged cryptography, across every topic.

17 questions · 5 unlocked for you

Concepts behind "cryptography"

Explanations of the mechanisms these questions rely on.

Foundational
Cryptography & PKI
Hashes, MACs and Digital SignaturesA hash turns any input into a fixed fingerprint, but anyone can recompute it, so it proves nothing on its own. A MAC adds a shared secret key, so only key holders can produce a valid tag. A digital signature uses a private key that only the signer holds and a public key anyone can use to verify, which adds non-repudiation. Choosing between them is a question of who holds which key.
Foundational
Cryptography & PKI
Symmetric Encryption and AEADSymmetric encryption uses one secret key to encrypt and decrypt. On its own it hides content but does not detect tampering, which has caused real attacks. Authenticated encryption with associated data (AEAD), such as AES-GCM or ChaCha20-Poly1305, encrypts and attaches a tag that makes any modification fail to decrypt. Its one hard rule is that a nonce must never repeat under the same key.
Foundational
Cryptography & PKI
How TLS 1.3 WorksTLS 1.3 sets up an encrypted, authenticated connection in one round trip. The client and server run an ephemeral Diffie-Hellman exchange to agree on fresh keys, the server proves its identity by signing the handshake with the private key behind its certificate, and both sides confirm with a MAC over everything exchanged. After that, data flows under AEAD encryption. TLS protects data in transit between two endpoints; it does not protect the endpoints, the data at rest, or decide who is allowed to do what.
Foundational
Cryptography & PKI
PKI and Certificate ChainsPublic key infrastructure answers the question signatures leave open: how do you know a public key belongs to who it claims? A certificate binds a name to a public key and is signed by a certificate authority. Clients trust a small set of root authorities and validate a chain from the server's certificate up to one of them, checking signatures, dates, names and constraints at each step. Certificate Transparency logs make mis-issued certificates detectable.
Core
Cryptography & PKISign in
Public-Key Cryptography and Key ExchangePublic-key cryptography gives each party a key pair: a public key that can be shared and a private key that never leaves its owner. It enables signatures and key exchange, which lets two parties who have never met agree on a shared secret over an observed network. Protocols use it to set up a session and then switch to fast symmetric encryption. Its weak point is knowing whose public key you have, and its long-term threat is quantum computing.
Advanced
Identity & Access🔒 Premium
Validating JWTs SafelyA JSON Web Token is a signed (sometimes encrypted) set of claims, whose safety depends on explicit verifier policy. Safe validation pins the allowed algorithm to each key, selects keys only from the configured issuer's key set, checks the token type, issuer, audience and time claims, treats header fields such as kid and jku as untrusted input, and keeps different token kinds mutually exclusive. Key rotation needs a schedule that accounts for cache lifetimes, token lifetimes and clock leeway.