First of all, first of all, encryption, here I use the base64 class
try {String asB64 = Base64.getEncoder().encodeToString("http://www.baidu.com".getBytes("utf-8"));System.out.println(asB64); } catch (UnsupportedEncodingException e) {// TODO Auto-generated catch blocke.printStackTrace();}The second is decryption,
byte[] asBytes = Base64.getDecoder().decode(asB64); System.out.println(new String(asBytes, "utf-8"));
The above example of the encryption and decryption of Java8 version base64 is the entire content shared by the editor. I hope it can give you a reference and I hope you can support Wulin.com more.