note: I am not a crpytographer
I want to check if my RSA Blind Signatures Implementation is secure to be used in a production-stage application and I also have some questions which I would be so grateful to be answered.
I did a lot of research in the last few days and came out with this:
Signature Issuing Stage
- Get the public key; exponent $e$, modulus $n$
- Generate a random number $r$ that is less than and relatively prime to the modulus $n$
- Calculate the hash of the private token $m$
- Calculate the blinded message $ M = h(m).(r^emod$ $n) $
- Send the blinded message to the server that will return the blinded signature $S = M^d mod $ $n$, where $d$ is the private exponent
- Calculate the unblinded signature $s = S.r^{-1}$
If I am correct, this will end up with a private token $m$ and its valid signature $s$
Question 1: How to multiply $h(m)$ and $r^emod$ $n$ ? Won't be the result greater than $n$ ?
Question 2: Can I just use any hash algorithm on $m$ like SHA-256 ?
Question 3: The server won't hash or pad the blinded message before signing it, Is that right and safe ?
Signature Verifing Stage
- The client sends its private token $m$ and its signature $s$
- The server will check the signature $s^e = h(m)$ $mod$ $n$
Question 4: How to implement a padding scheme to prevent signatures from being faked due to the homomorphic property of RSA ?
Question 5: Is this implementation vulnerable to any attacks ? Are there any improvements ?