Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulnerable to side-channel attacks on decryption and signing. #19

Closed
sybrenstuvel opened this issue Nov 15, 2013 · 1 comment
Closed

Comments

@sybrenstuvel
Copy link
Owner

Originally reported by: Manuel Aude Morales (Bitbucket: Mamsaac, GitHub: Mamsaac)


After checking the source code, it seems to me that the implementation is vulnerable to timing attacks, which RSA is particularly weak to, specially since the implementation is pure Python and doesn't use C.

Recommended way to prevent a timing attack would be to do blinding on decryption (you do that by blinding the encrypted value, decrypting and then unblinding. For more information, you can consult https://en.wikipedia.org/wiki/Blinding_%28cryptography%29) or PyCrypto's implementation (it has both C and Python implementation. On python's code, bllinding happens in:
https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/PublicKey/RSA.py#L243 and is implemented at https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/PublicKey/_slowmath.py#L41).


@sybrenstuvel
Copy link
Owner Author

Original comment by Sybren Stüvel (Bitbucket: sybren, GitHub: sybrenstuvel):


This doesn't seem too difficult to implement, thanks for the links. Not sure when I'll be able to add this though (only so many hours in a day).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant