第一步:引入 druid-1.0.1.jar 架包 第二步: 编写程序 package nihao; import com.alibaba.druid.filter.config.ConfigTools; public class er { @SuppressWarnings("static-access") public static void main(String[] args) { try { ConfigTools configTools = new ConfigTools (); //System.out.println(configTools.encrypt("Tanggang123@")); System.out.println(configTools.encrypt("root")); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }