简体   繁体   中英

RSA encryption without padding C#

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM