Open HimanshuParashar opened 7 years ago
I want to implement this in my IOS project. Is their any alternative solution for Objective-c / Swift code?
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
Thanks @kishanbarmawala I didn't have time to create one and the one you provided seems really good.
I want to implement this in my IOS project. Is their any alternative solution for Objective-c / Swift code?