logoalt Hacker News

stouset • today at 10:10 PM • 0 replies • view on HN

Not even close.

First, that seven lines of code includes a bignum arithmetic library, but the ones shipped with your language are not constant-time and not suitable in any way, shape, or form for use in cryptographic code.

Then it’s a pain in the ass and slow to encrypt large messages so literally nobody uses RSA to do so. They generate a symmetric key and use that to encrypt the message then use RSA to encrypt the symmetric key.

With both of those you’ve managed to get to a minimally useful but still laughably insecure RSA implementation.