To make an RSA signature, the signer first hash the message to be signed, then run RSA decryption on the following data to produce the signature:
00 01 FF FF FF ... FF 00 ASN.1 HASH
where ASN.1
is the ASN.1 notation for the hash algorithm used and HASH
is just the hash of the message.
To verify an RSA signature, the verifier simply encrypt the signature by raising the signature to the power of the public exponent to retrieve the original padded data with hash. He can then conclude–after verifying the padding and the hash–that only whoever knows the private key can produce this message.