在android中加密解密

时间:2012-02-13 04:42:15

标签: android encryption

我是android的新手。我想加密一个文件,我想解密它,在图像视图中显示它可以帮助我。我不知道加密和解密。

1 个答案:

答案 0 :(得分:2)

如果您有File of the file on the SD card,则可以read it into a byte[],并realImageContents = decrypt(fileContents)执行某项功能decrypt()。然后,您可以使用BitmapFactory获取Bitmap对象,并将其传递给ImageView.setImageBitmap()

查看javax.crypto使用实际加密算法。如果您只想对图像进行模糊处理,您可以编写自己的encrypt() / decrypt()来执行简单的操作,例如XOR cipher,并在您的应用程序中使用硬编码的密钥。

相关问题