Skip to content

Commit fd29158

Browse files
Amxxernestognw
andcommitted
Add warning about low public key exponent (#5234)
Co-authored-by: Ernesto García <ernestognw@gmail.com> Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
1 parent 4e2ac51 commit fd29158

File tree

1 file changed

+6
-2
lines changed
  • contracts/utils/cryptography

1 file changed

+6
-2
lines changed

contracts/utils/cryptography/RSA.sol

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ library RSA {
3636
* 2048 bits. If you use a smaller key, consider replacing it with a larger, more secure, one.
3737
*
3838
* WARNING: This verification algorithm doesn't prevent replayability. If called multiple times with the same
39-
* digest, public key and (valid signature), it will return true every time. Consider including an onchain nonce or
40-
* unique identifier in the message to prevent replay attacks.
39+
* digest, public key and (valid signature), it will return true every time. Consider including an onchain nonce
40+
* or unique identifier in the message to prevent replay attacks.
41+
*
42+
* WARNING: This verification algorithm supports any exponent. NIST recommends using `65537` (or higher).
43+
* That is the default value many libraries use, such as OpenSSL. Developers may choose to reject public keys
44+
* using a low exponent out of security concerns.
4145
*
4246
* @param digest the digest to verify
4347
* @param s is a buffer containing the signature

0 commit comments

Comments
 (0)