konstantinullrich / crypton

A simple Dart library for asymmetric encryption and digital signatures
https://pub.dev/packages/crypton
MIT License
34 stars 12 forks source link

Encryptions for images #12

Closed madurangae closed 4 years ago

madurangae commented 4 years ago

Hi! What is the recommended flow to encrypt images with this library? Thanks!

konstantinullrich commented 4 years ago

I would recommend reading the bytes of the Image and convert those to a base64 string, which you can encrypt.

I hope that helps. If you give me a few minutes, I'll try it

konstantinullrich commented 4 years ago

After some trying around, I concluded, It would be faster to encrypt the Images using a form of hybrid encryption.

For example, encrypt the Image with a synchronous encryption algorithm like AES and encrypt the key separately with an asynchronous algorithm. I know it's an extra step, but I'd reckon it'll improve the performance of your application.

madurangae commented 4 years ago

Thanks for the great tip!! It makes total sense to use the hybrid approach you have mentioned.