I have some images in my device's SD card. Now I want to encrypt them and save them into a path. and in another time be able to decrypt them. need a clear way to do this. Thanks.
Asked
Active
Viewed 190 times
2
-
Show us what have you tried? – David Jul 01 '16 at 08:34
-
@David: i get image's bytes and convert them to string and encrypt the string and again convert it to byte array and saved it. but when i try to get image back it does not return image. – karimkhan Jul 01 '16 at 08:36
-
https://gist.github.com/bricef/2436364 Small example how to use aes on java and c – Mykhailo Yuzheka Jul 01 '16 at 08:37
-
Thanks @user3280437 but i need image encryption not text encryption. – karimkhan Jul 01 '16 at 08:39
-
AES can be used for images as well as for text ... – Thilo Jul 01 '16 at 08:41
-
if your image is converted to string, text encryption is what you need. But if you want help you will have to show us what you tried, and the code of is not working (converting back string to data to image from what you said) – yan yankelevich Jul 01 '16 at 08:41
-
Convert those bytes to base64 string when encrypting/decrypting – Mykhailo Yuzheka Jul 01 '16 at 08:43
-
this is my code.[link](https://gist.github.com/anonymous/7170919c65b3cd521cb8b763488b04bc) – karimkhan Jul 01 '16 at 08:45
-
you don't encrypt the image. You are using a encoding algorithm. For the difference see http://stackoverflow.com/questions/4657416/difference-between-encoding-and-encryption – Mike Holtkamp Jul 01 '16 at 08:53
-
@MikeHoltkamp: can you please help me how to solve it. – karimkhan Jul 01 '16 at 09:10
-
What do you want to achieve with the image encryption? I assume that you want to prevent that another application opens the image file. Is that correct? Please take a look at the This question already has an answer here link – Mike Holtkamp Jul 01 '16 at 10:11