Open Kofil opened 8 years ago
Is their any alternative solution for Swift?
Use this pod: - https://github.com/krzyzanowskim/CryptoSwift/tree/swift32
extension String { func aes_Encrypt() -> String { let key = "0123456789abcdef" let iv = "fedcba9876543210" var result = "" do { let aes = try! AES(key: key, iv: iv, padding: Padding.zeroPadding) let encrypted = try aes.encrypt(Array(self.utf8)) result = encrypted.toHexString() } catch { print(error) } return result } }
// Use:-
let str = // YOUR STRING
let result = str.aes_Encrypt() // "result" is your encrypted string
Is their any alternative solution for Swift?