Skip to content

Support key persistence #175

@rillian

Description

@rillian

For some applications, it would helpful to persist the OPRF key across restarts, or clone it among a cluster of instances. Implementing this is somewhat sensitive, since the whole point of the PPOPRF is to keep the private key private. Currently the ppoprf crate doesn't expose the private key.

I suggest the following design:

  • Add a new command-line switch so star-randsrv --generate-key will create a ppoprf::Server and dump the private key to stdout, then terminate.
  • At startup, look for a STAR_RANDSRV_PRIVATE_KEY env variable, and if set, use that key to construct the OPRFServer state instead of a random one.

Terminating the application after generating the key separates the step from normal invocation, making it easier to keep the key material out of logs. Likewise with reading a existing key from the environment, rather than a command-line argument.

The shared key will be unpunctured. Passing the correct epoch synchronization arguments will take care of puncturing no-longer valid epochs as they would with a random key.

To implement, we will also need to extend the ppoprf crate with something like the following interface:

pub struct ServerPrivateKey(RistrettoScalar)

impl Server {
  pub fn get_private_key(&self) -> ServerPrivateKey {
    ...
  }
  pub fn from_private_key(&ServerPrivateKey) -> Self {
    ...
  }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions