简体   繁体   English

与其他应用程序android共享加密的图像

[英]Share an encrypted Image with other applications android

I'm developing an application on android platform to encrypt images and i'm using bouncy castle library and I'm doing fine with the encryption part but now when i get the encrypted image I can't send it through other applications like whatsapp and others because the encrypted image file is not recognized as an image file anymore so i cant send it. 我正在android平台上开发一个应用程序来加密图像,并且我正在使用充气城堡库,并且我在加密部分做得很好,但是现在当我获得加密的图像时,我无法通过whatsapp和其他,因为加密的图像文件不再被识别为图像文件,所以我不能发送它。 so can i add anything to the encrypted image so other applications can recognize it as an image and transmitted through it or do somthing else ... thanks 所以我可以向加密的图像添加任何内容,以便其他应用程序将其识别为图像并通过它传输或进行其他操作...谢谢

In order to transmit a ciphered message as an image, you need to define a custom protocol to wrap the ciphertext in some image exchange container format, for example PNG. 为了将加密的消息作为图像传输,您需要定义一个自定义协议,以某种图像交换容器格式(例如PNG)包装密文。

I wrote a simple program that encrypts an image (the message) and stores the ciphertext along side some meta information in a PNG-encoded container. 我编写了一个简单的程序 ,该程序对图像(消息)进行加密,并将密文与一些元信息一起存储在PNG编码的容器中。 The sources are on GitHub and the idea is: 来源在GitHub上,想法是:

  1. generate the secret key 生成密钥
  2. write headers to file 将标头写入文件
  3. encrypt the message (an image) and write to file 加密消息(图像)并写入文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM