How to do AES 128 encryption of a string in Swift using Xcode and send it as POST to the server?
How to do AES 128 encryption of a string in Swift using Xcode and send it as POST to the server?... I am new to Xcode and am learning to encrypt the string data and want to send to HTTP server. It is a basic iOS app for sending Latitude and Longitude of the device. Based on examples from: https://github.com/krzyzanowskim/CryptoSwift To encrypt a string using CryptoSwift: func encrypt(text: String) -> String? { if let aes = try? AES(key: "passwordpassword", iv: "drowssapdrowssap"), let encrypted = try? aes.encrypt(Array(text.utf8)) { return encrypted.toHexString() } return nil } To decrypt: