问题
I'd like to implement a blind RSA signature in .NET. Is there any way to use the standard System.Security.Cryptography
APIs to achieve this?
The "obvious" idea doesn't work:
using (var rsa = new RSACryptoServiceProvider())
signed = rsa.Decrypt(messageBytes, false);
// CryptographicException: bad data
I appreciate the dangers of blind signature but let's ignore those for a moment. Also, I'm not interested in other types of digital signatures.
回答1:
You are going to have to roll you own. You can use the BigInteger class of .NET 4 or just use the Bouncycastle C# library.
回答2:
You can use the "SignData" method to sign any data you like. It has overloads for byte arrays and streams. As far as the blinding goes, you would probably want to use encrypted data (using a key not available to the signer) and then sign that.
来源:https://stackoverflow.com/questions/4372271/blind-rsa-signature-using-net-cryptography-api