I am using SHA-512 to hash my passwords and store them in mysql database. Is there any requirement that the input to the sha-512 should not contain any special character? Because the passwords 'Qwerty123.1' and 'Qwerty123.' are being treated the same, but 'Qwerty.11' is not the same as the above. What is the problem?
The code that I am using is:
BASE64Decoder decoder=new BASE64Decoder();
byte[] b=decoder.decodeBuffer(r1); //r1 is the string containing password
MessageDigest md=MessageDigest.getInstance("SHA-512");
md.update(b);
byte[] plaintext=md.digest();
BASE64Encoder encoder=new BASE64Encoder();
String digest1=encoder.encode(plaintext); //digest1 contains the msg digest