Well, it's possible you're doing it properly ... but likely not. At CocoaConf Chicago Rob Napier gave a presentation on iOS security and highlighted his cross-platform AES encrypt/decrypt library, RNCryptor. You'll find implementations for Swift, Objective-C, Java, PHP, C, JavaScript, Haskell, Go, and many