I have an app which uses AES256 decryption for authentication. For this I use the Crypto Swift library.
Until now it always worked, but with iOS 13 coming out, the decryption does not work.
Here's the code I use for decryption:
func aesDecrypt(key: String) throws -> String {
let data = Serializer.hexaToBytes(self)
let key = Serializer.hexaToBytes(key)
let decrypted = try! AES(key: key, blockMode: ECB(), padding: .pkcs7).decrypt(data)
let decryptedData = Data(decrypted)
return String(bytes: decryptedData.bytes, encoding: .utf8) ?? "Could not decrypt"
}
String(bytes: decryptedData.bytes, encoding: .utf8)
always returns nil...
Why could that be and what should I do to make it working again?
Any help would be appreciated :)