Encrypting data with ruby decrypting with node

后端 未结 3 885
礼貌的吻别
礼貌的吻别 2021-02-08 19:55

I want to encrypt some data in a ruby app and then decode it in a nodejs app. I have been trying to get this to work and now I am just trying to encrypt the same piece of data i

3条回答
  •  -上瘾入骨i
    2021-02-08 20:44

    Your cyphertext will be some random looking bytes. Those bytes can be expressed as hex, Base64 or in other ways. It looks as if your ruby code is outputting the raw bytes. I suggest that you convert those raw bytes to hex to make your comparison.

    Looking at your code, you should also change from Blowfish ("bf") to AES. Blowfish has a 64-bit block size and is now obsolete.

    You would do well to explicitly specify padding, PKCS7 is common

提交回复
热议问题