Decrypt API response to string

354 Views Asked by At
let dd = aaa.value(forKey: "secret_key") as! String
let data = dd.data(using: .utf8)
let decryptedData = try? RNCryptor.decrypt(data: data, withPassword: password)
print(decryptedData)

I am using RNCryptor to convert encrypted data in response of service calls. I am getting the response as string . How can i decrypt the string response using RNCryptor. By using the above code, I am getting nil value.

0

There are 0 best solutions below