流浪少年  
个人网站 http://112.25.151.114:8098/MyWeb/main

首先,先是加密,这里我使用了base64类

try {
String asB64 = Base64.getEncoder().encodeToString("http://www.baidu.com".getBytes("utf-8"));
System.out.println(asB64);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

 

其次是解密,

byte[] asBytes = Base64.getDecoder().decode(asB64);
System.out.println(new String(asBytes, "utf-8"));

posted on 2017-12-06 09:39  流浪少年  阅读(11775)  评论(0编辑  收藏  举报