我们可以加密在Android的文件夹? [英] Can we Encrypt a folder in android?
问题描述
其实我是新来的机器人。我们可以加密文件夹其中 包含子文件夹和文件的SD卡和解密回来?
Actually I am new to android. Can we encrypt a folder which contains sub folders and files in sdcard and decrypt it back ?
任何帮助将大大AP preciated。
Any Help will be greatly appreciated.
感谢您。
推荐答案
如何利用新的你对Java有什么看法?您可以使用所有的 javax.security
和 javax.crypto中的
类(如密码
)在Android中,提供数据加密/解密。这里有许多用Java做简单的文件加密/解密在网络上的一个简单的例子。
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. Here is a simple example of many on the web using Java to do simple file encryption/decryption.
<一个href="http://www.exampledepot.com/egs/javax.crypto/DesFile.html">http://www.exampledepot.com/egs/javax.crypto/DesFile.html
请记住在SD卡上的文件可以被用户直接访问(无论是通过安装在PC上,探索或通过文件管理器应用程序),这意味着有机会的话,虽然他们未必能该文件中读取数据,用户理论上可以删除您创建那里,如果他们选择这样做...的目录和可能不犹太您的应用程序。
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.
希望帮助!
这篇关于我们可以加密在Android的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!