Functional Encryption
Functional Encryption (FE) lets a key holder learn a function of the plaintext without revealing the plaintext itself. From a ciphertext of and a functional key for a function , decryption returns only .
A common CTF instantiation is FE for inner products, where a key for a vector reveals only . It is often built on an elliptic curve, following the paper Simple Functional Encryption Schemes for Inner Products on a NIST curve.
Inner-product scheme
The setup samples two secret scalar vectors and publishes for two generators of the curve.
- Encryption of a binary vector uses a random scalar :
- A functional key for a vector is the pair (dot products over ).
- Decryption with that key returns only , never directly:
Attacks
Key oracle leaking the master key
If the key-generation oracle returns both the query vector and its key , every query is a linear equation over in the unknown and . Collecting queries (where is the vector length) gives two invertible systems and , where is the matrix of the query vectors. Recovering lets you decrypt each bit directly:
so if the result is the point at infinity and if it equals (no discrete log needed, just a point equality).
Per-ciphertext blinding defeated by collinearity
A patched scheme masks every bit with a fresh scalar (), so the residue becomes and the test no longer works. But for each known the partial decryption
is a small integer multiple () of the same hidden point . Recovering the small is not a discrete log: tabulate for a reference and match against it (a baby-step over small multiples) to read each ratio , then lift to integers with an . If the secret persists across re-keys, aggregating enough rounds yields far more than linear equations and is the unique solution over .