Skip to content
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.

Random IV support #5

Open
iditude opened this issue Feb 9, 2013 · 2 comments
Open

Random IV support #5

iditude opened this issue Feb 9, 2013 · 2 comments

Comments

@iditude
Copy link

iditude commented Feb 9, 2013

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...

@ghost
Copy link

ghost commented Mar 18, 2013

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.

@jfinkhaeuser
Copy link

Also see Gurpartap/aescrypt#4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants