Symmetric ciphers such as AES encrypt bulk data orders of magnitude faster per byte than public-key operations such as an RSA private-key operation or an elliptic-curve key-agreement step. Derive where that gap comes from in terms of what each primitive actually computes, and then compare the three topologies by which a shared symmetric key can get into place — an interactive key-agreement handshake, store-and-forward per-message key wrapping, and a key-management service that returns a data key both in usable and in protected form — saying what each one assumes about liveness and trust.
answer
- single-instruction rounds per block vs multi-word arithmetic per operation
- asymmetric cost is per operation, symmetric is per byte
- trapdoor structure, not implementation quality
- three topologies: agreement / wrapping / custodian
- forward secrecy comes from ephemerality, not from handshaking
basics
~20 sSymmetric ciphers are a few cheap CPU-level rounds over a fixed block, so cost is linear in bytes; public-key work is big-number modular exponentiation or curve point multiplication, costly per operation. Cost being per operation, key establishment picks a topology: interactive agreement (live peer, forward secrecy), per-message wrapping (no interaction), or a custodian-issued data key (online trusted service).
solid answer
~60 sA symmetric cipher is a few rounds of XOR, rotation, table lookup or a dedicated round instruction over a fixed block, so cost is linear in bytes with a tiny constant — gigabytes per second per core with hardware support. A public-key operation is arithmetic in a large algebraic structure: exponentiation modulo a thousands-of-bit integer, or scalar multiplication of a curve point — thousands of multi-word steps, tens of microseconds to about a millisecond **per operation**. The gap comes from the trapdoor structure itself, not from implementation quality; better engineering only moves the constant. So cost is per operation, and the real design question is how the symmetric key arrives. Three topologies: **interactive agreement** — both sides live, ephemeral shares, forward secrecy, needs authentication or you agreed a key with a middle; **store-and-forward wrapping** — no interaction, recipient keys known in advance, fan-out over recipients, no forward secrecy; **custodian-issued data keys** — an online trusted service keeps the master key out of the process, paid for in availability and a round trip. Liveness and trust constraints pick one.
code
text · 12 lines(a) interactive agreement
A <-- fresh ephemeral shares --> B ; both derive K, discard shares
assumes: live peer + authentication -> forward secrecy
(b) store-and-forward wrapping
sender: fresh K_msg protects payload ; K_msg protected once per recipient key
assumes: recipient offline, keys known in advance -> NO forward secrecy
(c) custodian-issued data key
app -> service: "issue a data key"
service -> app: (usable copy, protected copy) store protected copy with ciphertext
assumes: service online + trusted -> master key never in the processgo deeper
Recall the two cost classes — cheap fixed-size block operations versus heavy big-number arithmetic — and that the shared symmetric key has to be established by some separate mechanism, never sent in the clear.
Say clearly that asymmetric cost is per operation while symmetric cost is per byte, and name the three topologies with one assumption each: live peer, offline recipient, online trusted custodian.
Pick a topology from the constraints, state that forward secrecy comes from ephemerality rather than from handshaking, and connect the cost profile to operations: handshake rate is the DoS surface, per-key data limits force chunking with position binding, and rekeying is done by derivation.
Reason about combining topologies and their blast radius: custodian availability and trust as a coupled dependency, key-issuance rate and amortisation budgets, what recorded-traffic compromise costs you in each topology, and the chunking and rekey policy for very large or very long-lived data.
## Two classes of computation A symmetric cipher is assembled from operations a CPU already performs in a single instruction: XOR, addition, rotation, table lookup, or a dedicated round instruction. A block cipher applies a small fixed number of such rounds to a fixed-width block (128 bits for AES), so encrypting N bytes costs roughly N/16 times a small constant. The work is linear in the data and the per-unit constant is tiny; with hardware support for the round function and for the carry-less multiplication used by an authentication tag, a single core moves several gigabytes per second — usually faster than the disk or network it is feeding. A public-key operation computes in a large algebraic structure. An RSA-style operation is exponentiation modulo an integer of two to four thousand bits. An elliptic-curve agreement or signature step is scalar multiplication of a point: hundreds of doublings and additions, each itself several multi-word field multiplications. One such operation is thousands of arithmetic steps on numbers that do not fit in a register. As orders of magnitude: a symmetric block is nanoseconds, a curve scalar multiplication is tens of microseconds, an RSA-2048 private-key operation is around a millisecond. ## The gap belongs to the primitive, not the implementation Both families are heavily optimised, so the gap is not sloppy code on one side. An asymmetric primitive must carry enough mathematical structure for the public and private roles to differ — a trapdoor — and that structure is precisely what forces the arithmetic into a large group. You cannot engineer it away; you can pick a cheaper group (curves instead of big integers) and shift the constant. The consequence that matters architecturally is that asymmetric cost is **per operation** while symmetric cost is **per byte**, so the design question becomes how many public-key operations the system performs and when. That the payload therefore travels under a symmetric key which a public-key operation protects — the envelope construction, and the ceiling on how much a public-key encryption can carry — is derived under asymmetric/hybrid encryption; take it as established here. What remains is how the symmetric key gets into place, and there are only three topologies. ## Topology 1: interactive key agreement Both endpoints are live at the same time and exchange fresh key-agreement shares; each derives the same secret without it ever crossing the wire, and a key-derivation step turns it into working keys. Assumptions: a live peer, at least one round trip (zero-round-trip modes exist with their own replay caveats), and authentication of at least one side — otherwise you have successfully agreed a key with whoever sits in the middle. What it buys, when the shares are ephemeral and discarded afterwards, is forward secrecy: recovering a long-term private key later does not decrypt recorded traffic. If instead one side encrypts a key to the other's long-term static public key, there is no forward secrecy. The property comes from ephemerality, not from the fact that a handshake occurred. ## Topology 2: store-and-forward per-message wrapping There is no live peer. The sender generates a fresh symmetric key per message, protects the payload with it, and protects that key once for each intended recipient. Assumptions: recipient public keys are known in advance and their authenticity comes from outside the message (a directory, a certificate, a pinned fingerprint) — if that binding is weak, everything above it is; the recipient may be offline arbitrarily long, so the ciphertext must be self-describing about which key and which algorithm; and there is no forward secrecy, because whoever ever obtains the recipient's long-term private key can open the retained ciphertext years later. Fan-out is over recipients rather than over bytes. ## Topology 3: custodian-issued data keys A key-management service holds a master key that never leaves its boundary and issues freshly generated data keys, returning each in usable form and in a form only the service can reverse; the caller uses the usable copy, discards it from memory, and stores the other alongside the ciphertext. Assumptions: the custodian is online and available at both encrypt and decrypt time, so its outage becomes a data outage unless you cache; it is trusted, since it necessarily sees the plaintext data key it issued and is a single high-value compromise point; and each issuance is a network round trip, so you amortise one data key across a batch rather than calling per record. What you buy is that no long-term key material lives in your process, plus centralised authorisation, audit and revocation. ## Choosing, and what cost forces downstream The constraints pick the topology, not taste. Simultaneous liveness and a need to survive later key compromise push you to agreement. An offline or future recipient forces wrapping and rules forward secrecy out. A requirement that the process never hold long-term key material, plus tolerance for an operational dependency, points at a custodian. Real systems combine them — a custodian issues data keys for objects at rest while the transport between services uses agreement. The same cost asymmetry shapes three further decisions. Denial-of-service pressure sits on connection establishment rather than data transfer, because asymmetric work scales with connections and the side performing the private-key operation pays it; session resumption, connection reuse and handshake offload are capacity levers, not micro-optimisations. A single symmetric key has data limits — a birthday bound tied to the block size, and for authenticated modes a bound on distinct nonces — so very large objects are split into chunks, each protected separately with its position and the total count bound in, so chunks cannot be reordered, dropped or spliced. And long-lived streams rekey by deriving a fresh key from the already-established secret, which is symmetric-cheap, rather than repeating a handshake, which is not.
- A protocol performs a public-key handshake at connection setup. Does that by itself give forward secrecy?No. Forward secrecy comes from both sides contributing ephemeral key-agreement shares that are discarded once the working keys are derived. A handshake in which the client simply encrypts a key to the server's long-term static public key has no forward secrecy: anyone who later recovers that private key can decrypt every recorded session. The presence of asymmetric cryptography is not the property; the ephemerality of the secret material is.
- A service is hit with a burst of new TLS connections. Where does the CPU load actually land, and what do you do about it?On the asymmetric work at handshake time, which is per connection and includes the server's private-key operation, not on record encryption, which is per byte and cheap. The levers are therefore anything that reduces handshakes per unit of work: connection reuse and keep-alive, session resumption, and terminating or offloading the handshake at a tier you can scale independently. Rate-limiting connection establishment is a real defence in a way that rate-limiting bytes is not.
- Why do systems split a very large object into chunks instead of encrypting it in one pass under one key?A single symmetric key has usage limits — a birthday bound tied to the block size and, for authenticated modes, a bound on how many distinct nonces you can safely use — so a sufficiently large object under one key erodes the security margin. Chunking keeps each unit within safe bounds, but it introduces a new attack surface: an attacker could reorder, drop or splice chunks. The fix is binding each chunk's position and the total count into its authenticated data so any rearrangement fails verification.
Getting the shared key into place is like getting someone a house key: meet them and cut a fresh one together (agreement), post it in a box only they can open (wrapping), or have a front desk that issues a temporary key on request (custodian). Each assumes something different about who is present and who is trusted.
saying these in an interview costs you the question
- Explaining the speed gap as 'asymmetric libraries are just less optimised' or 'symmetric keys are shorter so there is less work' — the cost class comes from what the primitive computes, not from implementation quality or key length.
- Claiming any handshake gives forward secrecy; it comes from ephemeral agreement shares being generated and discarded, not from the existence of a public-key exchange.
- Treating a key-management service as free trust and free availability: it necessarily sees the data key it issues, and its outage becomes your data outage unless keys are cached.
- Assuming store-and-forward wrapping can be retrofitted with forward secrecy by rotating recipient keys later — anyone who ever recovers the old private key opens the ciphertext that was already sent.
- Sizing a service on bytes encrypted rather than on connections established, then being surprised that a handshake flood saturates CPU while throughput is nowhere near the limit.