Labels

algorithms (22) Design Patterns (20) java (19) linux (14) Snippet (13) service mix (6) soa (4)

MD5 Encryption

public static byte[] getEncrypted(String passwd) {

     try {

         MessageDigest md = MessageDigest.getInstance("MD5");

         byte[] pwd = passwd.getBytes();

         md.update(pwd);

         byte[] mdpwd = md.digest();

         return mdpwd;

         }

     catch (NoSuchAlgorithmException e) {

         e.printStackTrace();

     }

     return null;

}

2 comments:

  1. Great tip in case you want to encrypt the data. It's about using the proper code.

    ReplyDelete
  2. I just wanted to ask if you know the encrypt data for video, that once you close it. It will open by another tab? We are planning to do a prank to my friend. Thanks.

    ReplyDelete

Search 24 Bytes

Loading...