本文介绍了Android AES加密/解密图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到一种方法来加密/解密Android中的图像。我在Android编程中是新的,从来没有在任何其他平台上进行加密/解密,所以请提供一个很好的例子,因为我需要学习如何做它。我正在开展一个需要加密/解密图像的项目。如果能够帮助我,我会很高兴。
谢谢!

解决方案

你可以看看这个



请记住,这可能需要很多时间加密/解密图像。您还没有设置任何安全标准(这是多么安全),所以很难给出权威的答案。



更新



在您的评论之后,还有几件事要考虑。通常更快=不太安全。你真的想要保护图像,或者让它们不被授权的用户使用。



例如,您是否只想要在授权设备上查看图像,还是担心他们落入错误的手中?



我有一个问题,其中的图像应该只能显示在一个授权帐户的设备上,这很容易解决,与用户帐户相关联的唯一ID被用于加密数据,所以每个用户在设备和服务器上都有自己的(唯一)密钥,服务器端的加密是完成的。我也只需要加密部分数据(头 - 首4096字节),使其不可用,我不是想保持NSA解密图像,只是让它们不被轻易的解密和传递。



所以这是足够快速和安全的,这就是为什么我建议你在选择实施计划之前想出你想做什么和防范。


I need to find a way to encrypt/decrypt an images in Android.I'm new in Android programming and never been encrypt/decrypt on any other platform,so please provide me a good example,because I need to learn how to do it.I'm working on a project which needs to encrypt/decrypt images.I'll be really happy if you can help me about this.Thanks anyway!

解决方案

You can take a look at this Stackoverflow Encryption Accepted Answer

Keep in mind that this is probably going to take a lot of time to encrypt/decrypt images. You also have not set any security standards (how secure must this be) so it's hard to give an authoritative answer

Update

After your comment here are a few more things to think about. Typically faster = less secure. Are you really trying to secure the images or just make them unavailable to unauthorized users.

For instance do you only want the images to be viewable on an authorized device or are you worried about them falling into the wrong hands?

I had a problem where the images should only be shown on a device that was an authorized account, that was fairly easy to solve, a unique ID associated with the users account was used to encrypt the data, so each user had their own (unique) key on the device and on the server, encryption was done on the fly on the server side. I also only needed to encrypt part of the data (header - first 4096 bytes) to make it unusable, I wasn't trying to keep the NSA from decrypting the images, just keep them from being easily decrypted and passed around.

So that was fast and secure enough, this is why I am suggesting you figure out what you are trying to do and protect against before picking a implementation plan.

这篇关于Android AES加密/解密图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 20:50