PwdTools.java import com.alibaba.druid.filter.config.ConfigTools;public class PwdTools { /** * 加密 * * @param t 需要加密的密码 * @return * @throws Exception */ public static String Decrypt(String t) throws Exception { return Confi
import com.alibaba.druid.filter.config.ConfigTools;
public class PwdTools {
/**
* 加密
*
* @param t 需要加密的密码
* @return
* @throws Exception
*/
public static String Decrypt(String t) throws Exception {
return ConfigTools.encrypt(t);
}
/**
* 解密
*
* @param t 需要解密的密文
* @return
* @throws Exception
*/
public static String Encrypt(String t) throws Exception {
return ConfigTools.decrypt(t);
}
public static void main(String[] args) throws Exception {
String pwd = "test";
pwd = PwdTools.Decrypt(pwd);
System.out.println(pwd);
pwd = PwdTools.Encrypt(pwd);
System.out.println(pwd);
}
}
