Friday 28 April 2017

Decrypt in node js a cookie in rijndael-128-cbc

I have a cookie from prestashop, it is encrypted with mcrypt with rjindael-128-cbc.

The cookie value when decrypted should be :

date_add|2017-04-27 23:30:25¤id_lang|1¤id_currency|1¤id_guest|571369¤id_connections|590882¤checksum|2523349829

The app is calling a node backend and I am trying to decrypt the cookie in node to get user credentials. I've tried various answers, with node's native crypto library I only managed to extract gibberish.

The node-mcrypt module got me almost there but for some reason is mangling the first characters of the cookie:

���Ӱy��J" R�-27 23:30:25¤id_lang|1¤id_currency|1¤id_guest|571369¤id_connections|590882¤checksum|2523349829

In short I need to write in node lines 66-68 of the RijndaelCore class https://github.com/PrestaShop/PrestaShop/blob/1.6.1.x/classes/Rijndael.php



via Mister Fresh

No comments:

Post a Comment