21.08.2015 Views

RSA-PSS – Provably secure RSA Signatures and their ...

RSA-PSS – Provably secure RSA Signatures and their ...

RSA-PSS – Provably secure RSA Signatures and their ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

--- crypto / rsa / rsa_sign .c 26 Apr 2005 22:07:17 -0000 1.21+++ crypto / rsa / rsa_sign .c 4 Sep 2006 15:16:57 -0000@@ -185 ,6 +185 ,23 @@sig = d2i_X509_SIG (NULL ,&p ,( long )i);if ( sig == NULL ) goto err ;++ /* Excess data can be used to create forgeries */+ if(p != s+i)+ {+ <strong>RSA</strong>err ( <strong>RSA</strong>_F_<strong>RSA</strong>_VERIFY , <strong>RSA</strong>_R_BAD_SIGNATURE );+ goto err ;+ }++ /* Parameters to the signature algorithm can also be used to+ create forgeries */+ if(sig -> algor -> parameter+ && sig -> algor -> parameter -> type != V_ASN1_NULL )+ {+ <strong>RSA</strong>err ( <strong>RSA</strong>_F_<strong>RSA</strong>_VERIFY , <strong>RSA</strong>_R_BAD_SIGNATURE );+ goto err ;+ }+sigtype = OBJ_obj2nid (sig -> algor -> algorithm );Listing 2: Patch for OpenSSL to prevent Bleichenbacher attack4.1 Bleichenbacher Attack on PKCS #1 v1.5 ImplementationsAt the rump session of Crypto 2006, Daniel Bleichenbacher presented an attackagainst certain implementations of <strong>RSA</strong> with the PKCS #1 1.5 hash-then-signscheme (the attack has been written down by Hal Finney [Finney, 2006]). Theattack makes use of the rather simple structure of the <strong>RSA</strong> function’s input <strong>and</strong>the unused padding part.The message encoding in EMSA-PKCS1-v1 5 looks like this:00 01 FF FF ... FF 00 { ASN.1 { H(M)ASN.1 contains just an ID of the used hash algorithm, H(M) is the hash ofthe input message M. Several implementations did not calculate the length ofthe padding, instead they scanned the FFs until they found a zero byte. Thiscaused an input looking like this to be considered valid, too:00 01 FF FF ... FF 00 { ASN.1 { H(M) { garbageWith a small <strong>RSA</strong> exponent (the attack was shown for e = 3), by carefullyselecting “garbage”, it is possible to construct the input to be a perfect cube,which makes it possible to use the cube root as a valid signature.17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!