MD5加密解密

附件是MD5的拷贝了很多别人的,都不好用,这个不错


下面的base64的,但是64的严格说来不加密算法
package test;

import java.io.UnsupportedEncodingException;
import java.util.zip.DataFormatException;
import java.util.zip.Deflater;
import java.util.zip.Inflater;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;

import org.apache.commons.codec.binary.Base64;

public class chuanchuan {


public static void main(String[] args) throws DataFormatException, UnsupportedEncodingException{

String source = "abcd测试12323123123123123123123123123123123123123123123123";

byte[] inputTest = source.getBytes("UTF-8");
byte[] base64Data = Base64.encodeBase64(inputTest);
String target = new String(base64Data,"UTF-8");
System.out.println(target);

byte[] decode = Base64.decodeBase64(target);
String outTest = new String(decode,"UTF-8");

System.out.println(outTest);

}




}

你可能感兴趣的:(MD5加密解密)