FAQ Database Discussion Community


Generating an MD5 Hash with a char[]

java,security,hash,md5,message-digest
How would one go about converting a char[] password obtained using this method: char[] password = passwordInputField.getPassword(); To an MD5 Hash? Normally I would use the method below, but getBytes is only compatible with Strings: MessageDigest md = MessageDigest.getInstance("MD5"); md.update(password.getBytes()); String hashedPass = new BigInteger(1, md.digest()).toString(16); ...

java MD5 encryption minus value in byte array

java,encryption,bytearray,md5,message-digest
Hello I am using below code to encrypt a string. I found MD5 make working in -127 - +128 values. I am getting value in minus for. public static void main(String[] args) throws Exception { String message = "smile"; encrypt("Jack the Bear"); } public static void encrypt(String password) throws Exception...