← PKI playground

// demo

Registration-Based Encryption — Interactive Demo

This demo implements Registration-Based Encryption (RBE) following the base construction by Zhang, Ding, Malavolta and Döttling. A key curator with no secret manages the public keys, and everything the users do runs in your browser.

Demo with reduced parameters

// what is rbe, and why does it need no certificate?

In a classical PKI, Alice has her public key signed by a certificate authority, and anyone who wants to write to her checks that certificate. With identity-based encryption (IBE) her name is enough, but the central authority knows every secret key. That is called key escrow.

Registration-Based Encryption (RBE) combines the two: everyone generates their own key pair and only registers the public key with the key curator (KC). The KC compresses all public keys into one compact mpk. To encrypt, you only need mpk and the recipient's name.

The KC holds no secret. Everything it computes can be recomputed by anyone from public data. This demo implements the base construction from Section 3 of the paper: what the users do runs in your browser, the KC runs on the server, and in step 3 your browser audits it.

0

Setup: a public CRS with no backdoor

The KC publishes a random seed. SHAKE-256 expands it into the common reference string A = [A_0 | … | A_l]: 7 uniform blocks over the ring R_q, one per identity bit and one for the constant 1. Because A is derived from the seed alone, anyone can check that it hides no structure.

Parameters: demo and paper

The demo follows the construction from the paper exactly, but with smaller parameters so that it runs in milliseconds in the browser. The table compares the two.

↗ Underlying paper (ePrint 2026/628)
ParameterDemo
ConstructionBase RBE (Section 3)
Modulus q67,104,769 (26 bits)
Ring degree n_R256
Module rank n1
Gadget base d8 (m = 9)
Identity length l6 bits (64 identities)
Users N3
Ciphertext≈ 53 KiB

The construction works exactly as in the paper, but the parameters are heavily reduced. Among other things, the security proof needs a much larger modulus (for noise smudging) and longer identities. This demo therefore makes no security claim and is not meant for production use.

How this demo is implemented

  • It implements the base construction from Section 3. The CRS is a uniform matrix without a trapdoor, and the key curator holds no secret.
  • The CRS is expanded from a public seed with SHAKE-256. Identities are 6 bits taken from SHAKE-256 of the name.
  • The NOT gate inside the delta function is evaluated linearly (A_l − A_k) instead of multiplicatively as in Algorithms 3 to 5. Both satisfy the same equation from Theorem 4, but the linear version gives much shorter helper keys. That is what makes a 26-bit modulus sufficient.
  • In Algorithm 4 (line 9) and Algorithm 5 (line 11) of the paper the condition is flipped: it has to be (1 − i_k) instead of i_k. Implemented literally, Algorithm 4 satisfies Theorem 4 for none of 64 tested identity pairs; corrected, for all of them.
  • The chains for A_δi are precomputed once at registration (cf. the preprocessing in Section 5.1). A helper key is then just a sum of precomputed blocks.
  • Automated tests check the equations exactly: Theorem 4 for all identity pairs, (A − ĩ ⊗ G) · hsk_i = mpk − pk_i for every user, and a noise margin of at least six standard deviations.