Algorithm dossier

  • Category: Crypto
  • Worst-case complexity: O(log n)
  • Approach: Iterative
  • Data structure: No DS
  • First formalised: 1970s

Why this snippet is RSA Encryption Primitive

Why RSA. The public-key tuple destructure e, n = k is the diagnostic — RSA's public key is exactly *(exponent, modulus)*. The body is modular exponentiation: m^e mod n. Asymmetry. Encryption uses the public (e, n); decryption uses the private (d, n) where d = e^-1 mod φ(n). Same machinery, different exponent. Security rests on the hardness of factoring n to recover φ(n).

How to read a redacted algorithm

Algodle strips identifier names so the snippet has to be read for its shape: the control flow, the data structures it manipulates, the order in which it visits its input. Loops with two pointers crawling toward each other are usually search or partition. A recursion that splits its input in half and recurses on both halves is divide-and-conquer. A priority queue plus graph traversal is almost certainly Dijkstra, Prim, or A*. Six hint columns — category, complexity, approach, data structure, era — let you triangulate even when the snippet itself is opaque.