I need to implement salts in my encryption, but to do so, I need to store it in a file format that I need to create so I can later retrieve it to decrypt. I’m a noob when it comes to encryption. The specifications of the file format should be as so:
Ciphertext: length of ciphertext ;
Salt: length of salt ;
Then the ciphertext and salt written out. This is where xcode really confuses me, as in creating a new file, etc.
How can I do this? And then retrieve the salt for decryption?
Thank you, your help is greatly appreciated.
You might consider using
NSMutableDictionaryandNSKeyedUnarchiverlike this:Output:
EDIT
Response to comment: Both
NSDataandNSStringfeaturelength.Quick example:
Output: