I am new to swift, and would like to encrypt a string, using some symmetric encryption algorithm so that it is possible with the same decrypt key. I would like to know how this can be done in the Swift language.
I am new to swift, and would like to encrypt a string, using some symmetric encryption algorithm so that it is possible with the same decrypt key. I would like to know how this can be done in the Swift language.
Updated: I found a library that does this: link
and the code to resolve this problem:
let input = NSData()
let encrypted = try! input.encrypt(AES(key: "secret0key000000", iv:"0123456789012345"))
let input: [UInt8] = [0,1,2,3,4,5,6,7,8,9]
input.encrypt(AES(key: "secret0key000000", iv:"0123456789012345", blockMode: .CBC))