简体   繁体   English

RSA加密-公钥加密

[英]RSA Encryption - Public Key Encryption

I would like to use RSA encryption on a large file (>25 MB). 我想对大文件(> 25 MB)使用RSA加密。 Is it possible or are there limitations using a Public Key/Private Key for a large app? 对于大型应用程序,使用公钥/私钥是否可能存在限制? I am exposing a public key to clients and not allowing anyone but the recipient to view the contents with the private key. 我向客户公开了一个公钥,除了收件人以外,其他任何人都不能使用私钥查看内容。 So the business case makes sense although it will be slower than symmetrical encryption. 因此,尽管比对称加密要慢,但商业案例还是有意义的。

Thanks, 谢谢,

RSA cannot encrypt a payload larger than its key size (minus some overhead for padding). RSA无法加密大于其密钥大小的有效负载(减去填充的一些开销)。 To bypass this limitation you'll need to generate a symmetric key, use that to encrypt the larger file, then encrypt the symmetric key itself with RSA (with OAEP or PKCS1v1.5 padding). 要绕过此限制,您将需要生成对称密钥,使用该对称密钥对较大的文件进行加密,然后使用RSA(使用OAEP或PKCS1v1.5填充)对对称密钥本身进行加密。

Cryptographic Message Syntax (CMS) and PKCS7 (CMS's predecessor) support this use case already so there's no need to invent your own protocol. 加密消息语法(CMS)和PKCS7(CMS的前身)已经支持此用例,因此无需发明自己的协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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