user3981459
user3981459

Reputation: 23

How to encrypt/decrypt uploaded image php/xcode

I've been using this code to upload an image : how to post an image to the web server and it works fine.

My question is : is there a way to aes-256 encrypt the image with a passphrase before sending it and decrypting it with php on the server? It's like using these functions : AES Encryption for an NSString on the iPhone but instead of NSString, NSData.

Any help would be useful.

Upvotes: 1

Views: 1581

Answers (2)

Paresh Navadiya
Paresh Navadiya

Reputation: 38259

To my idea from iOS

you convert image to base64 string using this link

Now encrypt this string int AES264 using this link

On php side

Decrypt using this link

Decode base64 string using this link

Upvotes: 1

Soulan
Soulan

Reputation: 391

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

this is how you achieve image encryption of images in iOS (one way at least) you can then simply post the result. but you have to find a way to exchange your encryption key. It would not be clever to simply send your keys within the same request... and if so you should at least use https

Upvotes: 0

Related Questions