Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we Encrypt a folder in android?

Tags:

android

Actually I am new to android. Can we encrypt a folder which contains sub folders and files in sdcard and decrypt it back ?

Any Help will be greatly appreciated.

Thank you.

like image 844
FelixJohn Avatar asked Jun 07 '11 13:06

FelixJohn


1 Answers

How new are you to Java in general? You can use all the javax.security and javax.crypto classes (like Cipher) in Android to provide data encryption/decryption.

Keep in mind that files on the SD card can be accessed by the user directly (either by mounting on a PC and exploring or through File Manager apps), which means there is a chance that, while they may not be able to read the data in the file, a user could theoretically delete the directories you create there if they so choose...and that may not be kosher for your application.

Also, there really is no way to simply set up a folder as "encrypted" and automatically have any file there be protected for you. You would need to create the directory you want to use, and then encrypt/decrypt each file as you write/read the data.

Hope that helps!

like image 178
devunwired Avatar answered Sep 30 '22 03:09

devunwired