Can two different BASE64 encoded strings result into same string if decoded?

后端 未结 2 946
刺人心
刺人心 2021-02-10 01:33

On client side I am doing an MD5 encryption of a string and then a BASE 64 encoding on the hash generated.

This final encoded string is then used for comparison on serve

2条回答
  •  广开言路
    2021-02-10 02:31

    The accepted answer solves the problem but does not answer the question.

    For example, these base64 values QzNWwq== and QzNWwr== encode the same binary value (hex) 433356c2

    You can check it at http://kjur.github.io/jsjws/tool_b64udec.html or using the command

    echo <> | base64 -d | xxd
    

    In summary

    • Two different base 64 encode same value --> true
    • Two different values generate the same base64 value --> false (see this)

提交回复
热议问题