RSA encryption without padding C#

只愿长相守 提交于 2019-12-20 05:31:22

问题


I'll set the scene,

I'm required to compute RSA encryption on a given set of bytes using a 512 bit key. This can be achieved easily with the RSACryptoServiceProvider class, however I'm required to precompute custom padding for the encryption prior to computing the RSA encryption.

This custom padding does not conform with the PKCS#1 v1.5 or v2 provided in the RSACryptoServiceProvider's Encrypt method. Are there any alternatives C# classes that I could use to compute the RSA Encryption without adding their own padding?

I'm currently looking at OpenSSL.Net as an alternative, but are there others which are better/

Any help would be appriciated. Thanks.


回答1:


In principle you could implement it yourself on BigInteger using ModPow. But that will be relatively slow, and for private key operations it's wide open to timing side-channel attacks.

I believe Mono.Security (you can use it on normal .net) contains classes that support unpadded RSA.



来源:https://stackoverflow.com/questions/10719088/rsa-encryption-without-padding-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!