Different output encryption both CryptoJS and Java Code

后端 未结 3 1517
攒了一身酷
攒了一身酷 2021-01-31 12:10

I need to encrypt certainly string from client-side (JavaScript) and decrypt from server-side (Java), so I found CryptoJS and I write the code with the same params/configuration

3条回答
  •  一生所求
    2021-01-31 13:01

    The character '0' is not the same as hex value 0. The CryptoJS key is most likely different than the Java key because you're instantiating them as different object types. Print out the keys/IV in both languages after creating them and compare.

    EDIT: That said, this will probably be moved to StackOverflow, as questions about specific crypto libraries are not on-topic here.

提交回复
热议问题