如何加密/解密上传的图像php / xcode

时间:2014-08-27 05:43:41

标签: php objective-c xcode

我一直在使用此代码上传图片:how to post an image to the web server 它工作正常。

我的问题是:有没有办法让aes-256在发送它之前用密码加密图像并在服务器上用php解密它?这就像使用这些函数:AES Encryption for an NSString on the iPhone而不是NSString,NSData。

任何帮助都会有用。

2 个答案:

答案 0 :(得分:1)

来自 iOS

的想法

convert imagebase64字符串使用this link

现在encryptstring int AES264使用this link

在php端

Decrypt使用this link

Decode base64 string使用this link

答案 1 :(得分:0)

http://highaltitudehacks.com/2013/09/26/ios-dev-encrypted-images-and-saving-them-in-app-sandbox/

这就是你如何在iOS中实现图像的图像加密(至少一种方式),然后你可以简单地发布结果。但你必须找到一种方法来交换加密密钥。简单地在同一请求中发送密钥并不聪明......如果是这样,你至少应该使用https