Today I'm going to show you how to make MD5 Hashes. There is a built in method of doing this inside Java. Here is a demonstration of what it looks like: Code:JAVA //Start Encrypting processString keyedpass = args[1];//Stores What the was try {MessageDigest m = MessageDigest.getInstance("MD5");//Sets the Encrypting type to MD5m.reset();m.update(keyedpass.getBytes());//Gets a byte array of the string aka Passwordbyte[] digest = m.digest();BigInteger bigInt = new BigInteger(1, digest);//Gets the new byte array of the Encrypted textString hashtext = bigInt.toString(16);//Turns the Byte Array into a string.while (hashtext.length() < 32) {hashtext = 0+hashtext;//Makes the MD5 Encryption readable. 0 = padding.} *ended up commenting instead of making more paragraphs* If you have any questions feel free to ask! Picture of my plugin showing what a simple Password (Hello) Turns into:
LOL No, not it isn't but it was just an example. Thanks for reading =) Edit: As a side note, the hash IS CASE SENSITVE so Hello will turn out different then hello.
I wouldn't recommend using md5 for hashing passwords, it was broken a while ago. Use at least Sha1 instead for passwords.
Randomly place random non-related characters. Make sure you know how to undo what you did/Check with the same letter you salted with. As for salting a password, for minecraft related things, it's not really needed. Sha-1 isn't needed. MD-5 will fit your needs.
Ok, thanks. Also I was doing some research into this the other day and some people recommended MD5'ing the password 1000 times via an iterator. Do you think this is needed?
Or, the very compact version: Code:Java new BigInteger(1, MessageDigest.getInstance("MD5").digest(err.getBytes())).toString();
iKeirNez Yes, it will work. Its practically the same as the original answer, only made much more compact.
I like to use him sometimes and store him in my database, its very dark in there. Occasionally he gets to come out but not for long.
You really shouldn't use MD5 for password hashing. It's not just theoretically broken, it's easily brute-forced in practice. Salting can help, but it doesn't solve the fundamental problem - MD5 was not designed for password hashing. As it's primary application is verifying data integrity (checksums), it has a very high throughput (even without a GPU). Unfortunately, that also makes it vulnerable to brute-forcing. Instead, use a hash algorithm that's designed for password hashing, such as Bcrypt or PBKDF2. Though ... don't crank the "strenght" too high - otherwise you might have to put the hashing on a separate thread.