I have a project that I’m working on that requires me to send data out to a third party in an encrypted format. We chose AES-256 as the encryption for the data.
I’m using PHP and the other party is using VB. I’m using the MCrypt Library to do my encryption on my end.
I can’t seem to match my encryption to their encryption. Is a shared initial vector required, in addition to a shared key phrase? Are there any other things to take into consideration to make allow my data to be decrypted by the other party?
Additionally I’ve been told that VB uses a byte array for the IV. With the MCrypt library the examples use regular strings such as “1234567890123456” for the IV. Should I assume all that is required is a conversion from the above string to a byte array and all will be well?
Everything needs to be the same at both ends: IV, key, mode (use CBC or CTR) and padding (use PKCS#7). If any of these if different then things will fail. Crypto systems are designed to fail if anything is wrong.