Openssl - Initialization vector cannot be used?

I am encrypting something in my server (using php). 

The encryption is done with aes-256-cbc as method, a password and  an initialization vector , which is generated by my php script. 

The problem is there is no option as far as I can see in the opennssl decrypt function, for using an initialization vector… 

Is it not possible?

If it’s not documented, then we likely do not support it.  We would probably need you to file a feature request at http://feedback.coronalabs.com 

and get it voted up so we can try to work it into our engineering team’s schedule.

Rob

Hi, awkaw.  It’s undocumented, but it’s there.  Here’s a snippet from a project that uses encryption to talk to web services - just add an iv parameter…

local key = "xxx" local \_cipher = ssl.get\_cipher('aes-256-cbc') function cipher.encrypt(data)   -- generate random iv   local iv = ""   for i = 1, 16 do     iv = iv .. string.char(math.random(0, 255))   end   return mime.b64(iv .. \_cipher:encrypt(data, key, iv)) end

:ph34r:

Thank you. I need to decrypt, not encrypt.

I also decrypt …

cipher:decrypt(data, key, iv)

… just add the iv parameter

If it’s not documented, then we likely do not support it.  We would probably need you to file a feature request at http://feedback.coronalabs.com 

and get it voted up so we can try to work it into our engineering team’s schedule.

Rob

Hi, awkaw.  It’s undocumented, but it’s there.  Here’s a snippet from a project that uses encryption to talk to web services - just add an iv parameter…

local key = "xxx" local \_cipher = ssl.get\_cipher('aes-256-cbc') function cipher.encrypt(data)   -- generate random iv   local iv = ""   for i = 1, 16 do     iv = iv .. string.char(math.random(0, 255))   end   return mime.b64(iv .. \_cipher:encrypt(data, key, iv)) end

:ph34r:

Thank you. I need to decrypt, not encrypt.

I also decrypt …

cipher:decrypt(data, key, iv)

… just add the iv parameter