Image file encryption with c#

Asked

Viewed 115 times

0

Hello.

I receive an array of bytes containing the image. I need to record this image in an encrypted file and not the encrypted content and save it to directory. How to do this directly without having to save the original image in directory and then read this image and generate the encrypted file ?

Att,

Teles

  • What encryption?

1 answer

1

From what I understand the image should be part of a file with other data and this file, in turn, will be encrypted. So, I’m not sure what your file structure looks like, but you can convert the image byte array into a Base64 string, and then insert that string into your file. To convert the byte array into a Base64 string you can use the method: Convert.ToBase64String(). When you want to get the byte array from the string in Base64, you can use the method Convert.FromBase64String().

Browser other questions tagged

You are not signed in. Login or sign up in order to post.