# openfire-encrypt **Repository Path**: weishengshui/openfire-encrypt ## Basic Information - **Project Name**: openfire-encrypt - **Description**: openfire加密密码的方式 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-07-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #openfire-encrypt ```java package demo; import junit.framework.Assert; import com.zdekun.fastdfs.Blowfish; /** * openfire加密密码的方式 * * @author sean * */ public class Main { public static void main(String[] args) { // key就是ofProperty表中的passwordKey对应的值 String key = "12345HABSDk4321"; String plainPassword = "123456"; Blowfish blowfish = new Blowfish(key); String encryptPassword = blowfish.encrypt(plainPassword); System.out.println("encryptPassword=" + encryptPassword); String decryptPassword = blowfish.decrypt(encryptPassword); // 验证解密后,还是原来的密码明文 Assert.assertTrue(plainPassword.equals(decryptPassword)); } } ```