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
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