0.1.0 |
|
---|
#13 in #blind
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.
- The client creates a random message, and blinds it with a random, secret factor.
- The server receives the blind message, signs it and returns a blind signature.
- 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. - 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
~10MB
~175K SLoC