AESCrypt-ObjC
AESCrypt-ObjC copied to clipboard
Random IV support
Hello there,
I saw a closed issue about IV support and I can see from this code that IV is supported... But with a fixed IV, isn't it?
I mean, what usually happens is:
- encrypt with a random generated IV and add the IV at the beginning of the encrypted data (for instance 16 random characters)
- decrypt by extracting the IV at the beginning (first 16 characters) of the encrypted string and then decrypt...
Is this doable?
Thanks a lot...
I wanted (almost) the same, so I added two methods +encrypt:password:iv: and +decryptWithIV:password: on my fork https://github.com/whateva0x29a/AESCrypt-ObjC Maybe thats what your looking for. (to create a random string use something like this: https://github.com/gerasim13/NSString-Random)
Edit: Using your own IV is a little more secure than the current method, but you still should salt the password. On the other hand if you salt your password and set an own IV you can just use the CommonCrypto framework. I think this repo is for everyone searching a very easy way to encrypt and decrypt data using AES (though unsecure), but if you want a secure crypting method you should use CommonCrypto instead.
Also see https://github.com/Gurpartap/aescrypt/issues/4