I have an application that exchanges data between vendor’s application in a TripleDES Encrytion using CBC method upon an agreed key and IV. My application is a VB.NET application while the vendor’s application is a PHP web page. The strange thing is that I cannot seem to match the output of the vendor’s application.
The key and initial vector are given to both of us in plaintext. The funny thing is, in the vendor’s application, they don’t hash or convert the key and IV to a 256 bit key and 128 bit IV. They just use the plaintext format in their code using mcrypt plugin in PHP.
$key = 'plaintextkey'; $iv = 'plaintextIV' $enc = mcrypt_encrypt(MCRYPT_3DES, $key, $string, MCRYPT_MODE_CBC, $iv)
And it resulted in a funny text such as:
My questions are:
- should a plaintext be used as a parameter, how does PHP
implement/convert it into a 256 bit character?
- if CBC method is used, shouldn’t it depend on the previously
- is there a TripleDES result in my given format? Because as I
searched through the internet and never have I seen a resulted
encryption in such form.
I am really really new to encryption so I am very confused. If you can also provide me an article or video on encryption for total newbs I would really really appreciate it.