如何解决“ dataPaddingRequired”错误CryptoSwift

时间:2019-10-27 18:25:46

标签: swift cryptography aes cryptoswift

我有key = "somesomesomesome".md5(),长度为32个字节,iv为空,尝试使用CryptoSwift解密加密的字符串:

let aes = try AES(key: key.bytes, blockMode: CBC(iv: []), padding: .noPadding)
let result = try aes.decrypt(encrypted)
let decrypted = String(bytes: result, encoding: .utf8)

获取错误“ dataPaddingRequired”。我在做什么错了?

0 个答案:

没有答案