通过CryptoJS快速加密解密AES加密数据

时间:2017-12-18 16:36:18

标签: swift

func decrypt() -> String {
        var result = ""
        do {
            let aes = try AES(key: Constant.AES.key.bytes, blockMode: .CBC(iv: Constant.AES.key.bytes))
            let temp = try aes.decrypt(self.bytes)
            result = String(bytes: temp, encoding: .utf8)!
        } catch {
            print("Error: \(error)")
        }
        return result
    }

无法解密使用过的很多lib,如cryptoswift和cyrptoJS swift

0 个答案:

没有答案