Skip to content

decrypt a message encrypted in php #61

@smart--petea

Description

@smart--petea

Hi. I have an Yii application using "rijndael-128", "ofb" with IV. The encrypted message is saved in mysql and read in a node.js application. I try to decrypt it. The message is stored in mysql as blob and node-mysql transform it in a Buffer. I do not change it. My algorithm is

let message = ....; //Buffer
let Decipher = new MCrypt("rijndael-128", "ofb");
let ivSize = Decipher.getIvSize();
let iv = message.slice(0, ivSize); //IV
Decipher.open(encryptionKey, iv); //encryptionKey is considered as password on Yii side
console.log(Decipher.decypher(message.slice(ivSize)); //decyper only the encrypted part, without IV
//the result printed by console.log is = "correct message" + "garbage"

How could I get rid of the garbage from the decrypted message?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions