快速、“便宜”图像加密

发布于 2024-09-26 05:16:26 字数 341 浏览 5 评论 0原文

我需要一个可以在低功耗设备(手机、平板电脑等)上快速加密图像的函数/库。

我需要提供一个可以充当加密和解密图像文件的密码的字符串。

理想情况下,我想要保留图像文件格式并仅扰乱像素的东西。我尝试过对此进行原型设计,但未能找到有效的方法(在 PC 上加密需要 10-30 秒,在设备上崩溃)。这里的想法是直观地向用户显示他们的图像已被加密。我意识到我可能不得不伪造这个功能,或者完全不使用它。

我需要在客户端对图像文件进行加密并将其发送到可以存储该图像的服务器,而无需用户担心谁可以访问它。加密不必非常严格(参考美国国家安全局的问题)。用户稍后将下载该图像文件并使用密码进行解密。

有没有符合这个描述的东西?

I have a need of a function/library that can quickly encrypt an image on a low-powered device (cell phone, tablet, etc).

I need to provide a string which can act as a password to encrypt and decrypt the image file.

Ideally, I would like something that retains the image file format and just scrambles the pixels. I have tried prototyping this and haven't been able to find an efficient method to do so (10-30 seconds to encrypt on a PC, crashes on device). The idea here is to visually show the user that their image has been encrypted. I realize that I may have to fake this feature, or do without it completely.

I need the image file to be encrypted on the client and sent to a server where it can be stored without the user worrying about who can access it. The encryption doesn't have to be terribly tough (referring to the NSA question). The image file will then later be downloaded by the user and decrypted with a password.

Is there anything out there that fits this description?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

走过海棠暮 2024-10-03 05:16:27

我会尝试 AES。通常,与图像压缩等其他步骤相比,加密的瓶颈要小得多。但当然,如果不知道设置的任何具体细节,就很难做出可靠的预测。

I'd try AES. Often the encryption is much less of a bottle neck than other steps, such as image compression. But of course, whithout knowing any specific details of your setup it is hard to make reliable predictions.

旧时模样 2024-10-03 05:16:27

RC4 算法速度快(它基本上是具有非常好的会话密钥的异或运算)并且灵活,如果您找到适合您的手机平台的实现。但请注意,RC4 需要完美的会话密钥,即首先需要良好的随机数据源。 RC4 标准(IIRC)对此类随机化器有规范,但我不知道是否所有提供加密本身的库也提供随机化功能。

请注意,加密的强随机化器不能被常规 rand() 或类似函数替代。

RC4 algorithm is fast (it's basicly XOR operation with really good session key) and flexible, if you find implementation for it for your cellphone platform. Be aware, though, that RC4 requires perfect session key, i.e. good source of random data first of all. RC4 standard (IIRC) has specification for such randomizer but I don't know if all libraries, that provide encryption itself also offer randomization function.

Note, that cryptographically strong randomizer can't be replaced by regular rand() or similar functions.

星星的轨迹 2024-10-03 05:16:27

什么是图像加密?你是说隐写术? (将数据隐藏在图像中?)

还是图像压缩?例如 PNG/GIF/Jpeg?

如果您只是指加密密码,那么您可以选择 Blowfish/RSA/DES/AES/Rijndael,它们对构成图像的实际数据进行加密。

What is image encryption? you mean Steganography? (Hiding data inside images?)

or image compression? such as PNG/GIF/Jpeg?

if you just mean encryption cipher there is many you can pick out Blowfish/RSA/DES/AES/Rijndael which encrypt the actual data that makes up the image.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文