You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered: