开发者

Email Attachment Encryption - RSA or AES?

开发者 https://www.devze.com 2023-03-12 11:32 出处:网络
I\'m developing an email server from scratch for a custom project. I understand RSA and AES but where I am lost is in handling attachments. I want to send Alice a 开发者_Python百科signed message and I

I'm developing an email server from scratch for a custom project. I understand RSA and AES but where I am lost is in handling attachments. I want to send Alice a 开发者_Python百科signed message and I also want to send her an encrypted file attachment. How are attachments typically handled in this scenario?

Thanks in advance!


Attachments are big files and asymmetric encryption is really slow (i.e. RSA) so it is best to generate an AES key and encrypt it with the RSA public key and then encrypt the attachment with a lot faster AES. Then send both the encrypted key & attachment to the recipient. As only she got the private key, only she can decrypt the AES key thus can decrypt the attachment.

0

精彩评论

暂无评论...
验证码 换一张
取 消