Ad End 1 August 2025
Ad Ends 13 July 2025
ad End 25 October 2025
Ad Ends 20 April 2025
Ad expire at 5 August 2024
banner Expire 9 June 2025
banner Expire 25 October 2025
banner Expire 10 May 2025
What's new
Wizard's shop 2.0
Money Club cc shop
banner Expire 15 January 2025
banner Expire 20 October 2024
UniCvv
Yale Lodge
Kfc CLub
adv exp at 30 July 2025
Carding.pw carding forum
BidenCash Shop

File_closed07

TRUSTED VERIFIED SELLER
Staff member
Joined
Jun 13, 2020
Messages
7,907
Reaction score
943
Points
212
Awards
2
  • trusted user
  • Rich User
MD5 is one of the famous Hash algorithm. This algorithm is used in many websites for storing the password in encrypted form. The MD5 message-digest algorithm was developed by Ronald Rivest at MIT in 1992. This algorithm takes a input message of arbitrary length and produces a 128-bit hash value of the message.
MD5 is one way encryption method,means only encryption no decryption(but there is lot of hackers helping site to decrypt it).

For java programmers it is easy to encrypt the password with MD5. How? go ahead…
For two days , i didn’t post anything because i was doing my NIIT project. Yesterday only i finished it. My project is Online banking service. In my project i have planned to store the password in encrypted password. But i don’t know how to do that? When i search for algorithm in internet, i came to know that java itself have MD5 algorithm Class. I got surprised. Now my project’s customers password are stored in 128 bit encrypted form.
Now I will help you how to use the MD5 Class in java.
Step 1:

  • First of all you have to create a class named as “ByteToHex” for future use.
  • Delete Main function(if you are working in netbeans)
  • Create a new Function named as “byteToHex()”
The Source code should be :
package Model;
public class ByteToHex {

public static String bytesToHex(byte[] b) {
char hexDigit[] = {‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’,
‘8’, ‘9’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’};
StringBuffer buf = new StringBuffer();
for (int j=0; j<b.length; j++) {
buf.append(hexDigit[(b[j] >>4) & 0x0f]);
buf.append(hexDigit[b[j] & 0x0f]);
}
return buf.toString();
}
}
Save the file
Step 2:

  • create a new class with main fucntion.
  • import the following packages :
import Model.ByteToHex;

import java.security.MessageDigest;

Use the following code for MD5 encryption:
/*MD5 Encryption goes here-1 way encryption*/
String cipher=null;
try
{
MessageDigest md = MessageDigest.getInstance(“MD5”);
String input=password; //storing the password in input string
md.update(input.getBytes()); //storing the password in md object as bytes
byte[] output = md.digest(); //producing the 128 bit output using the md5 algorithm
cipher= ByteToHex.bytesToHex(output); //converting the bytes to string and storing in cipher String
}
catch (Exception e) {
System.out.println(“Exception: “+e);
}
/*MD5 Encryption ends here-1 way encryption*/
I hope you understand. if you have doubts ,comment here. I will help you. This program is only for Java programs. in future i will give you MD5 code for PHP.

you can use SHA-1 algorithm also .By Editing the following line :
MessageDigest.getInstance(“MD5”);
as
MessageDigest.getInstance(“SHA-1”);
 
Ad End 1 February 2024
Top