#blind #rsa #signatures #crypto #signature

yanked rust-blind-rsa-signatures

RSA blind signatures in pure Rust

0.1.0 Feb 25, 2021

#13 in #blind

MIT license

12KB
242 lines

Blind RSA signatures

Author-blinded RSASSA-PSS RSAE signatures.

This is an implementation of the RSA Blind Signatures proposal, based on the Zig implementation.

Protocol overview

A client asks a server to sign a message. The server receives the message, and returns the signature.

Using that (message, signature) pair, the client can locally compute a second, valid (message', signature') pair.

Anyone can verify that (message', signature') is valid for the server's public key, even though the server didn't see that pair before. But no one besides the client can link (message', signature') to (message, signature).

Using that scheme, a server can issue a token and verify that a client has a valid token, without being able to link both actions to the same client.

  1. The client creates a random message, and blinds it with a random, secret factor.
  2. The server receives the blind message, signs it and returns a blind signature.
  3. From the blind signature, and knowing the secret factor, the client can locally compute a (message, signature) pair that can be verified using the server's public key.
  4. Anyone, including the server, can thus later verify that (message, signature) is valid, without knowing when step 2 occurred.

The scheme was designed by David Chaum, and was originally implemented for anonymizing DigiCash transactions.

Usage

let kp = KeyPair::generate(2048)?;
let (pk, sk) = (kp.pk, kp.sk);

let msg = b"test";
let blinding_result = pk.blind(msg)?;
let blind_sig = sk.blind_sign(&blinding_result.blind_msg)?;
let sig = pk.finalize(&blind_sig, &blinding_result.secret, &msg)?;
sig.verify(&pk, msg)?;

Dependencies

~9MB
~168K SLoC