RSA can also be used as an asymmetric signature scheme. The roles of the keys are reversed compared to encryption.
Malleability
The malleability of RSA can be used to generate valid signatures for new messages from signatures of other messages. If and are valid signatures, then
is a valid signature for the message .
Furthermore, if the private key’s owner is willing to sign only some messages, an attacker can obtain arbitrary signatures. To sign a message , the attacker chooses with , asks for a signature on , and computes
Case : Since , either or . Assume (the other case is symmetric). Then for some .
Since , Euler’s theorem gives . Hence
Therefore for some , and
Issues
Determinism
If the same message is encrypted multiple times with the same public key, the produced ciphertexts are the same. Textbook RSA is deterministic.
Small Messages and Public Exponents
Given a ciphertext , it holds that for some . When both and are small, is not much larger than , and the plaintext can be reconstructed by brute-forcing the possible values of and computing the \textsuperscript{th} root:
Padding
The plaintext is extended with randomly generated components to bring it to the size of the modulus . The padded plaintext is then encrypted as usual. Usage of padding prevents both previous attacks (determinism and small messages).
PKCS#1 v. 1.5
Simple, but vulnerabilities are known.
Definition
Optimal Asymmetric Encryption Padding
Optimal Asymmetric Encryption Padding (OAEP) is a padding algorithm for RSA encryption. It is recommended for new applications.