Symmetric cryptography swift

0

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.

    
asked by anonymous 17.01.2016 / 16:40

1 answer

0

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))
    
07.11.2016 / 04:09