Rabin signature algorithm


In cryptography the Rabin signature algorithm is a method of digital signature originally proposed by Michael O. Rabin in 1979. The Rabin signature algorithm was one of the first digital signature schemes proposed, and it is the only one to relate the hardness of forgery directly to the problem of integer factorization. The Rabin signature algorithm is existentially unforgeable in the random oracle model assuming the integer factorization problem is intractable. The Rabin signature algorithm is also closely related to the Rabin cryptosystem.
But, the RSA cryptosystem has a prominent role in the early days of public key cryptography, and the Rabin signature algorithm is not covered in most introductory courses on cryptography.

Equations

If H is a collision resistant hash function, m the message to sign and
the signature S is given by the equation
Everybody can verify
if the value is public.

Original algorithm - insecure without hash function

The secure algorithm relies on a collision-resistant hash function.
In most presentations the algorithm is simplified by choosing. The hash function H with k output bits is assumed to be a random oracle and the algorithm works as follows:
;Key generation:
;Signing:
;Verification:

Remarks

In some treatments the random pad U is eliminated. Instead we can eventually multiply the hash value with two numbers a or b with the properties and, where denotes the legendre symbol. Then for any H modulo n exactly one of the four numbers will be a square modulo n, and the signer chooses that one for his signature.
Even more simple, we change the message m until the signature can be verified.

def root:
"""Rabin signature algorithm."""
while True:
x = h
sig = pow * p * pow
sig = %
if % nrabin x:
print
f = open
f.write
f.close
break
m = m + ' '
return sig

Security

If the hash function H is a random oracle, i.e. its output is truly random in, then forging a signature on any message m is as hard as
calculating the square root of a random element in.
To prove that taking a random square root is as hard as factoring, we first note that in most cases there are four distinct square roots since n has two square roots modulo p and two square roots modulo q, and each pair gives a square root modulo n by the chinese remainder theorem. Some of the four roots may have the same value, but only with extreme low probability.
Now, if we can find two different square roots, x,y such that but , then this immediately leads to a factorization of n since n divides but it does not divide either factor. Thus taking will lead to a nontrivial factorization of n.
Now, we assume an efficient algorithm exists to find at least one square root. Then we pick a random r modulo n and square it, then, using the algorithm we take one square root of R modulo n, we will get a new square root, and with probability half.