注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

刘小龙

成功需要的是一场持久的战役!

 
 
 

日志

 
 

搜集的几个常用的加密Java代码工具类  

2015-04-07 17:13:45|  分类: 知识积累 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
一,Java的MD5加密一:
  1.    /** 
  2.      * MD5 加密 
  3.      */  
  4.     private String getMD5Str(String str) {  
  5.         MessageDigest messageDigest = null;  
  6.   
  7.         try {  
  8.             messageDigest = MessageDigest.getInstance("MD5");  
  9.   
  10.             messageDigest.reset();  
  11.   
  12.             messageDigest.update(str.getBytes("UTF-8"));  
  13.         } catch (NoSuchAlgorithmException e) {  
  14.             System.out.println("NoSuchAlgorithmException caught!");  
  15.             System.exit(-1);  
  16.         } catch (UnsupportedEncodingException e) {  
  17.             e.printStackTrace();  
  18.         }  
  19.   
  20.         byte[] byteArray = messageDigest.digest();  
  21.   
  22.         StringBuffer md5StrBuff = new StringBuffer();  
  23.   
  24.         for (int i = 0; i < byteArray.length; i++) {              
  25.             if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)  
  26.                 md5StrBuff.append("0").append(Integer.toHexString(0xFF & byteArray[i]));  
  27.             else  
  28.                 md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));  
  29.         }  
  30.   
  31.         return md5StrBuff.toString();  
  32.     }  


二,Java的MD5加密二:
  1. import java.security.MessageDigest;  
  2. public class MD5Util {  
  3.     public final static String MD5(String s) {  
  4.         char hexDigits[] = { '0''1''2''3''4',  
  5.                              '5''6''7''8''9',  
  6.                              'A''B''C''D''E''F' };  
  7.         try {  
  8.             byte[] btInput = s.getBytes();  
  9.      //获得MD5摘要算法的 MessageDigest 对象  
  10.             MessageDigest mdInst = MessageDigest.getInstance("MD5");  
  11.      //使用指定的字节更新摘要  
  12.             mdInst.update(btInput);  
  13.      //获得密文  
  14.             byte[] md = mdInst.digest();  
  15.      //把密文转换成十六进制的字符串形式  
  16.             int j = md.length;  
  17.             char str[] = new char[j * 2];  
  18.             int k = 0;  
  19.             for (int i = 0; i < j; i++) {  
  20.                 byte byte0 = md[i];  
  21.                 str[k++] = hexDigits[byte0 >>> 4 & 0xf];  
  22.                 str[k++] = hexDigits[byte0 & 0xf];  
  23.             }  
  24.             return new String(str);  
  25.         }  
  26.         catch (Exception e) {  
  27.             e.printStackTrace();  
  28.             return null;  
  29.         }  
  30.     }  
  31.     public static void main(String[] args) {  
  32.         System.out.print(MD5Util.MD5("password"));  
  33.     }  


三,Java的Md5测试例子:

  1. package com.zyg.security.md5;  
  2.   
  3. import java.io.UnsupportedEncodingException;  
  4. import java.security.MessageDigest;  
  5. import java.security.NoSuchAlgorithmException;  
  6. import java.security.SecureRandom;  
  7. import java.util.Arrays;  
  8.   
  9. public class MyMD5Util {  
  10.       
  11.     private static final String HEX_NUMS_STR="0123456789ABCDEF";  
  12.     private static final Integer SALT_LENGTH = 12;  
  13.       
  14.     /**  
  15.      * 将16进制字符串转换成字节数组  
  16.      * @param hex  
  17.      * @return  
  18.      */  
  19.     public static byte[] hexStringToByte(String hex) {  
  20.         int len = (hex.length() / 2);  
  21.         byte[] result = new byte[len];  
  22.         char[] hexChars = hex.toCharArray();  
  23.         for (int i = 0; i < len; i++) {  
  24.             int pos = i * 2;  
  25.             result[i] = (byte) (HEX_NUMS_STR.indexOf(hexChars[pos]) << 4   
  26.                             | HEX_NUMS_STR.indexOf(hexChars[pos + 1]));  
  27.         }  
  28.         return result;  
  29.     }  
  30.   
  31.       
  32.     /** 
  33.      * 将指定byte数组转换成16进制字符串 
  34.      * @param b 
  35.      * @return 
  36.      */  
  37.     public static String byteToHexString(byte[] b) {  
  38.         StringBuffer hexString = new StringBuffer();  
  39.         for (int i = 0; i < b.length; i++) {  
  40.             String hex = Integer.toHexString(b[i] & 0xFF);  
  41.             if (hex.length() == 1) {  
  42.                 hex = '0' + hex;  
  43.             }  
  44.             hexString.append(hex.toUpperCase());  
  45.         }  
  46.         return hexString.toString();  
  47.     }  
  48.       
  49.     /** 
  50.      * 验证口令是否合法 
  51.      * @param password 
  52.      * @param passwordInDb 
  53.      * @return 
  54.      * @throws NoSuchAlgorithmException 
  55.      * @throws UnsupportedEncodingException 
  56.      */  
  57.     public static boolean validPassword(String password, String passwordInDb)  
  58.             throws NoSuchAlgorithmException, UnsupportedEncodingException {  
  59.         //将16进制字符串格式口令转换成字节数组  
  60.         byte[] pwdInDb = hexStringToByte(passwordInDb);  
  61.         //声明盐变量  
  62.         byte[] salt = new byte[SALT_LENGTH];  
  63.         //将盐从数据库中保存的口令字节数组中提取出来  
  64.         System.arraycopy(pwdInDb, 0, salt, 0, SALT_LENGTH);  
  65.         //创建消息摘要对象  
  66.         MessageDigest md = MessageDigest.getInstance("MD5");  
  67.         //将盐数据传入消息摘要对象  
  68.         md.update(salt);  
  69.         //将口令的数据传给消息摘要对象  
  70.         md.update(password.getBytes("UTF-8"));  
  71.         //生成输入口令的消息摘要  
  72.         byte[] digest = md.digest();  
  73.         //声明一个保存数据库中口令消息摘要的变量  
  74.         byte[] digestInDb = new byte[pwdInDb.length - SALT_LENGTH];  
  75.         //取得数据库中口令的消息摘要  
  76.         System.arraycopy(pwdInDb, SALT_LENGTH, digestInDb, 0, digestInDb.length);  
  77.         //比较根据输入口令生成的消息摘要和数据库中消息摘要是否相同  
  78.         if (Arrays.equals(digest, digestInDb)) {  
  79.             //口令正确返回口令匹配消息  
  80.             return true;  
  81.         } else {  
  82.             //口令不正确返回口令不匹配消息  
  83.             return false;  
  84.         }  
  85.     }  
  86.   
  87.   
  88.     /** 
  89.      * 获得加密后的16进制形式口令 
  90.      * @param password 
  91.      * @return 
  92.      * @throws NoSuchAlgorithmException 
  93.      * @throws UnsupportedEncodingException 
  94.      */  
  95.     public static String getEncryptedPwd(String password)  
  96.             throws NoSuchAlgorithmException, UnsupportedEncodingException {  
  97.         //声明加密后的口令数组变量  
  98.         byte[] pwd = null;  
  99.         //随机数生成器  
  100.         SecureRandom random = new SecureRandom();  
  101.         //声明盐数组变量  
  102.         byte[] salt = new byte[SALT_LENGTH];  
  103.         //将随机数放入盐变量中  
  104.         random.nextBytes(salt);  
  105.   
  106.         //声明消息摘要对象  
  107.         MessageDigest md = null;  
  108.         //创建消息摘要  
  109.         md = MessageDigest.getInstance("MD5");  
  110.         //将盐数据传入消息摘要对象  
  111.         md.update(salt);  
  112.         //将口令的数据传给消息摘要对象  
  113.         md.update(password.getBytes("UTF-8"));  
  114.         //获得消息摘要的字节数组  
  115.         byte[] digest = md.digest();  
  116.   
  117.         //因为要在口令的字节数组中存放盐,所以加上盐的字节长度  
  118.         pwd = new byte[digest.length + SALT_LENGTH];  
  119.         //将盐的字节拷贝到生成的加密口令字节数组的前12个字节,以便在验证口令时取出盐  
  120.         System.arraycopy(salt, 0, pwd, 0, SALT_LENGTH);  
  121.         //将消息摘要拷贝到加密口令字节数组从第13个字节开始的字节  
  122.         System.arraycopy(digest, 0, pwd, SALT_LENGTH, digest.length);  
  123.         //将字节数组格式加密后的口令转化为16进制字符串格式的口令  
  124.         return byteToHexString(pwd);  
  125.     }  
  126. }  

 

测试类——Client,代码如下:

  1. package com.zyg.security.md5;  
  2.   
  3. import java.io.UnsupportedEncodingException;  
  4. import java.security.NoSuchAlgorithmException;  
  5. import java.util.HashMap;  
  6. import java.util.Map;  
  7.   
  8. public class Client {  
  9.     private static Map users = new HashMap();  
  10.       
  11.     public static void main(String[] args){  
  12.         String userName = "zyg";  
  13.         String password = "123";  
  14.         registerUser(userName,password);  
  15.           
  16.         userName = "changong";  
  17.         password = "456";  
  18.         registerUser(userName,password);  
  19.           
  20.         String loginUserId = "zyg";  
  21.         String pwd = "1232";  
  22.         try {  
  23.             if(loginValid(loginUserId,pwd)){  
  24.                 System.out.println("欢迎登陆!!!");  
  25.             }else{  
  26.                 System.out.println("口令错误,请重新输入!!!");  
  27.             }  
  28.         } catch (NoSuchAlgorithmException e) {  
  29.             // TODO Auto-generated catch block  
  30.             e.printStackTrace();  
  31.         } catch (UnsupportedEncodingException e) {  
  32.             // TODO Auto-generated catch block  
  33.             e.printStackTrace();  
  34.         }   
  35.     }  
  36.       
  37.     /** 
  38.      * 注册用户 
  39.      *  
  40.      * @param userName 
  41.      * @param password 
  42.      */  
  43.     public static void registerUser(String userName,String password){  
  44.         String encryptedPwd = null;  
  45.         try {  
  46.             encryptedPwd = MyMD5Util.getEncryptedPwd(password);  
  47.               
  48.             users.put(userName, encryptedPwd);  
  49.               
  50.         } catch (NoSuchAlgorithmException e) {  
  51.             // TODO Auto-generated catch block  
  52.             e.printStackTrace();  
  53.         } catch (UnsupportedEncodingException e) {  
  54.             // TODO Auto-generated catch block  
  55.             e.printStackTrace();  
  56.         }  
  57.     }  
  58.       
  59.     /** 
  60.      * 验证登陆 
  61.      *  
  62.      * @param userName 
  63.      * @param password 
  64.      * @return 
  65.      * @throws UnsupportedEncodingException  
  66.      * @throws NoSuchAlgorithmException  
  67.      */  
  68.     public static boolean loginValid(String userName,String password)   
  69.                 throws NoSuchAlgorithmException, UnsupportedEncodingException{  
  70.         String pwdInDb = (String)users.get(userName);  
  71.         if(null!=pwdInDb){ // 该用户存在  
  72.                 return MyMD5Util.validPassword(password, pwdInDb);  
  73.         }else{  
  74.             System.out.println("不存在该用户!!!");  
  75.             return false;  
  76.         }  
  77.     }  
  78. }  

四,BASE64,MD5,SHA,HMAC加密與解密算法(java)

复制代码
  1 package com.ice.webos.util.security;
2
3 import java.io.UnsupportedEncodingException;
4 import java.math.BigInteger;
5 import java.security.Key;
6 import java.security.MessageDigest;
7 import java.security.SecureRandom;
8
9 import javax.crypto.Cipher;
10 import javax.crypto.KeyGenerator;
11 import javax.crypto.Mac;
12 import javax.crypto.SecretKey;
13 import javax.crypto.SecretKeyFactory;
14 import javax.crypto.spec.DESKeySpec;
15 import javax.crypto.spec.SecretKeySpec;
16
17 import sun.misc.BASE64Decoder;
18 import sun.misc.BASE64Encoder;
19
20 /**
21 * <ul>
22 * <li>BASE64的加密解密是双向的,可以求反解。</li>
23 * <li>MD5、SHA以及HMAC是单向加密,任何数据加密后只会产生唯一的一个加密串,通常用来校验数据在传输过程中是否被修改。</li>
24 * <li>HMAC算法有一个密钥,增强了数据传输过程中的安全性,强化了算法外的不可控因素。</li>
25 * <li>DES DES-Data Encryption Standard,即数据加密算法。
26 * DES算法的入口参数有三个:Key、Data、Mode。
27 * <ul>
28 * <li>Key:8个字节共64位,是DES算法的工作密钥;</li>
29 * <li>Data:8个字节64位,是要被加密或被解密的数据;</li>
30 * <li>Mode:DES的工作方式,有两种:加密或解密。</li>
31 * </ul>
32 * </li>
33 * <ul>
34 *
35 * @author Ice_Liu
36 *
37 */
38 public class CryptUtil {
39 private static final String KEY_MD5 = "MD5";
40 private static final String KEY_SHA = "SHA";
41 /**
42 * MAC算法可选以下多种算法
43 *
44 * <pre>
45 *
46 * HmacMD5
47 * HmacSHA1
48 * HmacSHA256
49 * HmacSHA384
50 * HmacSHA512
51 * </pre>
52 */
53 public static final String KEY_MAC = "HmacMD5";
54
55 /**
56 * BASE64解密
57 *
58 * @param key
59 * @return
60 * @throws Exception
61 */
62 public static byte[] decryptBASE64(String key) throws Exception {
63 return (new BASE64Decoder()).decodeBuffer(key);
64 }
65
66 /**
67 * BASE64 加密
68 *
69 * @param key
70 * @return
71 * @throws Exception
72 */
73 public static String encryptBASE64(byte[] key) throws Exception {
74 return (new BASE64Encoder()).encodeBuffer(key);
75 }
76
77 /**
78 * MD5加密
79 *
80 * @param data
81 * @return
82 * @throws Exception
83 */
84 public static byte[] encryptMD5(byte[] data) throws Exception {
85
86 MessageDigest md5 = MessageDigest.getInstance(KEY_MD5);
87 md5.update(data);
88
89 return md5.digest();
90
91 }
92
93 /**
94 * SHA加密
95 *
96 * @param data
97 * @return
98 * @throws Exception
99 */
100 public static byte[] encryptSHA(byte[] data) throws Exception {
101
102 MessageDigest sha = MessageDigest.getInstance(KEY_SHA);
103 sha.update(data);
104
105 return sha.digest();
106
107 }
108
109 /**
110 * 初始化HMAC密钥
111 *
112 * @return
113 * @throws Exception
114 */
115 public static String initMacKey() throws Exception {
116 KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_MAC);
117 SecretKey secretKey = keyGenerator.generateKey();
118 return encryptBASE64(secretKey.getEncoded());
119 }
120
121 /**
122 * HMAC 加密
123 *
124 * @param data
125 * @param key
126 * @return
127 * @throws Exception
128 */
129 public static byte[] encryptHMAC(byte[] data, String keyor: rgb(0, 128, 128); line-height: 1.5 !important;" >113 * staA 128, ght: 1.5 !important;" >byte[] ,nalstaA 1!important;" ant.doF!imp md5.update(data);
*
124
/**
127 38

* <pre>



*
*
45 *
*
*
*
127 * </pre>
128 */
129 public static *
124
/**
52 *
*
124 * @param *
*
125 * *
*
* @throws Exception
127 */
[] data, String keyor: rgb(0, 128, 128); line-height: 1.5 !important;" >113 * Exception {
[]Fac y = 5 !importFac yor = KeyGenerALGORITHMtKey.getEncoded());
6 n> encrypcretKeFac yor = keyG5 !imp(dkstKey.getEncoded());
*
124
* * *
*
[], ALGORITHMtKey.getEncoded());
encrypKey.getEncoded());
119 }
*
124
* *
*
*
*
*
* @param data
* @param *
*
124 * *
*
* @throws Exception
78 */
public static bytan>[] encryptHMAC([] data, String keyor: rgb(0, 128, 128); line-height: 1.5 !important;" >113 * 119 }
85
/**
* SHA加密
124 *
*
* @param data
124 * @param *
*
* *
*
* @throws Exception
*/
public static bytean>[] encryptHMAC([] data, String keyor: rgb(0, 128, 128); line-height: 1.5 !important;" >113 byte[] tKey.getEncoded());
*
124
/**
*
*
124 * *
*
* @throws Exception
124 */
public staticthrows Exception {
*
124
/**
*
*
114 * @param *
*
* *
*
* @throws Exception
*/
public staticstatseed data, String keyor: rgb(0, 128, 128); line-height: 1.5 !important;" >113 * byte *
124
*
124
byteBASE64(n> encrypor =EncodedretKey.getEncoded());
119 }
*
124
public sta[] args) Exception {
*
124
byte *
124
sta(16))Key.getEncoded());
*
124
sta(16))Key.getEncoded());
*
124
sta(16))Key.getEncoded());
*
124
sta(16))Key.getEncoded());
Exception {
* *
*
Exception {
* *
*
119 }
119 }

class="ptcp"5 paddiclass="iblock bcmimg"> 评论这张class="ptcp"5 paddiclass="nbc-0 nbc-0-40 ptcmi"5 img src="http://b.bst.126.net/28,page/images/microblog.png?1" /5 /" 5 paddiclass="nbc-0 nbc-0-40 ptcmt">转发至微博 /" 5 /" 5  class="ptcp"5 paddiclass="nbc-0 nbc-0-40 ptcmi"5 img src="http://b.bst.126.net/28,page/images/microblog.png?1" /5 /" 5 paddiclass="nbc-0 nbc-0-40 ptcmt">转发至微博 /" 5 /" 5 阅读S paddiid="$_" iReadCount">6importan) /" 5 paddiclass="sep fc07">| /" 5 <" >class="fc07">评论S paddiid="$_" iCommentCount">height: ) /" 5 /div5
| /" 5 div class="share-wrap pleft;5 paddiid="$_"hareBtn_lofter" title="分享到LOFTER" class="shareitm lofter f-bkicons"> id="$_"hareBtn_sinaweibo" title="分享到新浪微博" class="shareitm sinawb f-bkicons"> id="$_"hareBtn_qq" title="分享到QQ空间" class="shareitm qqzone f-bkicons"> id="$_"hareBtn_qqweibo" title="分享到腾讯微博" class="shareitm qqweibo f-bkicons">  div class="code2dimlayer fc06;5 img src="http://blog.163.com/b

用微信  “扫一扫”

将文章分享到朋友圈。

  div class="code2dimlayer fc06;5 img src="http://blog.163.com/b div class="tips">

用易信  “扫一扫”

将文章分享到朋友圈。

  style="x; paddblackt" ><" >style="x; paddrgb( 0px3 0plor:paddmargin: t margin: 0 stywidth: auto; border: 0 st" >&nbsp; &nbsp; !i</" >&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" style="x; paddblackt" ><" >style="x; paddrgb( 0px3 0plor:paddmargin: t margin: 0 stywidth: auto; border: 0 st" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;MD5&nbsp;;" </" >&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128,t: 18 st" ><" >style="x; paddblackt" ><" >style="x; paddrgb( 0px3 0plor:paddmargin: t margin: 0 stywidth: auto; border: 0 st" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128,t: 18 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >priv> </" >&nbsp; >sta&nbsp;getMD5 >( >sta&nbsp;str)&nbsp;{&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDigest&nbsp;messageDigest&nbsp;=&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >nulp</" >;&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >try</" >&nbsp;{&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrt line-height: 18 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;messageDigest&nbsp;=&nbsp;MessageDigestor =InstanceS<" >style="x; paddbluet" >"MD5"</" >);&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrt line-height: 18 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;messageDigest.resetStK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;messageDigest.upd> (stror =Bytes(<" >style="x; paddbluet" >"UTF-8"</" >)tK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >catch</" >&nbsp;(NoSuchAlgorithmException&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x, 25x; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<" >style="x; paddbluet" >"NoSuchAlgorithmException&nbsp;caught!"</" >)K&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrt line-height: 18 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.exit(-<" >style="x; paddrgb(192, 0plor" >1</" >tK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >catch</" >&nbsp;(UnsupporsedEncodingException&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25 0p25x; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTraceStK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >byte</" >[]&nbsp;byteArray&nbsp;=&nbsp;messageDigest.digestStK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; color: rgb(0, 128, 08 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >staBuffer&nbsp;md5 >Buff&nbsp;=&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >28,</" >&nbsp; >staBufferStK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; color: rgb(0, 128, 08 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >for</" >&nbsp;S<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >int</" >&nbsp;i&nbsp;=&nbsp;<" >style="x; paddrgb(192, 0plor" >0</" >K&nbsp;i&nbsp;&lt;&nbsp;byteArray.length;&nbsp;i++)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >if</" >&nbsp;(Integer.toHex >staS<" >style="x; paddrgb(192, 0plor" >0xFF</" >&nbsp;&amp;&nbsp;byteArray[i]).length()&nbsp;==&nbsp;<" >style="x; paddrgb(192, 0plor" >1</" >t&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md5 >Buff.appendS<" >style="x; paddbluet" >"0"</" >).appendSInteger.toHex >staS<" >style="x; paddrgb(192, 0plor" >0xFF</" >&nbsp;&amp;&nbsp;byteArray[i])tK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >else</" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md5 >Buff.appendSInteger.toHex >staS<" >style="x; paddrgb(192, 0plor" >0xFF</" >&nbsp;&amp;&nbsp;byteArray[i])tK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrg line-height: 18 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="x; paddrgb(1270pl, 8irgbfont-weight: boldt" >!impor</" >&nbsp;md5 >Buff.to >sta(tK&nbsp;&nbsp;</" ></li><li style="font-size: 1em; margin: 0 s 0 s 0 s 38 st paddmargin: 0 s 0 s 10 styborder-left-width: 1 st border-left-style: solidgbborder-left-x; padding:20i, 215, 22lor:background-x; padding:25x; cox; coxrgb(128, 128, 1288 st" ><" >style="x; paddblackt" >&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;</" ></li></ol><div><font f ce="Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Consolas, Courier New, mono" ce" ><" >style="font-size: 12 st line-height: 21 st" ><br></" ></font></div></div><div><font f ce="Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Consolas, Courier New, mono" ce" ><" >style="font-size: 12 st line-height: 21 st" ><br></" ></font></div><div><font f ce="Monaco, DejaVu Sans Mono, Bitstream Vera Sans Mono, Consolas, Courier New, mono" ce" size="3" ><" >style="line-height: 21 st" >二,Java的MD5;" 二:</" ></font></div><div><ol start="1" style="border: nonet list-style- osition: icstyle="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >impors</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;java.security.MessageDigest;&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; pa: rgb(255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >class</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;MD5Util&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; paddrgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >finap</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp; >sta&nbsp;MD5( >sta&nbsp;s)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >char</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;hexDigits[]&nbsp;=&nbsp;{&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'0'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'1'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'2'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'3'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'4'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pa: rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'5'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'6'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'7'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'8'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'9'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pa: rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'A'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'B'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'C'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'D'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'E'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >,&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >'F'</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;};&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pa: rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >try</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; paddrgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;b=Input&nbsp;=&nbsp;sor =Bytes(tK&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 8irgbx; padding:25i, 1530p153rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1530p2040plor:background-x; paddinherit;" >//获得MD5摘要算法的&nbsp;MessageDigest&nbsp;对象</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; paddrgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDigest&nbsp;mdInst&nbsp;=&nbsp;MessageDigestor =InstanceS<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >"MD5"</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >tK&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1530p2040plor:background-x; paddinherit;" >//使用指定的字节更新摘要</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonegbx; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mdInst.upd> (b=InputtK&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 8irgbx; padding:25i, 1530p153rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1530p2040plor:background-x; paddinherit;" >//获得密文</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sgbpadding: 0 sgbborder: nonegbx; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;md&nbsp;=&nbsp;mdInst.digestStK&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pad rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1530p2040plor:background-x; paddinherit;" >//把密文转换成十六进制的字符串形式</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sgbpadding: 0 sgbborder: nonegbx; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin sgbborder: nonegbx; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;j&nbsp;=&nbsp;md.length;&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pa: rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >char</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;str[]&nbsp;=&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >28,</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >char</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[j&nbsp;*&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >2</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >];&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pad rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;k&nbsp;=&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >for</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;S</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;i&nbsp;=&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >;&nbsp;i&nbsp;&lt;&nbsp;j;&nbsp;i++)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 8irgbx; padding:25i, 1530p153rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;byte0&nbsp;=&nbsp;md[i];&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pa: rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str[k++]&nbsp;=&nbsp;hexDigits[byte0&nbsp;&gt;&gt;&gt;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >4</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;&amp;&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >0xf</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >];&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str[k++]&nbsp;=&nbsp;hexDigits[byte0&nbsp;&amp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >0xf</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >];&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rg line-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 8irgbx; padding:25i, 1530p153rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >28,</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp; >sta(strtK&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >catch</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;(Exception&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTr ce(tK&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 8irgbx; padding:25i, 1530p153rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >nulp</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pa: rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:1020p2040p25irgbbackground-x; paddinherit;bfont-weight: boldt" >void</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;main( >sta[]&nbsp;args)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.print(MD5Util.MD5(<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:25i, 1530plor:background-x; paddinherit;" >"password"</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >)tK&nbsp;&nbsp;</" ></" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; pad rgb(85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant; border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:1530px530px53rgb(1st-style:e imal-leading-zero outsidegbbackground-x; padding:85, 85, 85rgbx; padding:255, 1530px53rgb(1ne-height: 18 st" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p2040plor:background-x; paddinherit;" >}&nbsp;</" ></li></ol><div><font x; pa="#00cc00" f ce="Consolas, Courier New, Courier, mono, serif" ><" >style="font-size:e12 sgbline-height: 21 sg" ><br></" ></font></div></div><div><br></div><div>三,Java的Md5测试例子:</div><div><p align="left" style="margin: 0cm 0cm 0pt;bfont-family: Arial;bfont-size:e14 sgbline-height: 26 sg" ><" >style="font-size:e12 t;bx; padding: 0p176, 8lor:font-family: 宋体g" ></" ></p><div style="font-family: Consolas, 'Courier New', Courier, mono, serif;bfont-size:e12 sgbbackground-x; paddrgb(231, 229, 22lor:width: 936.53125 sgboverflow: autogbpadding-top:e1 sgbmargin: 18px 0px !important;"b ><ol start="1"b style="border: nonegblist-style-position: initial;blist-style-image:einitial;bbackground-x; paddrgb(25i, 25i, 25ior:x; padding:92, 92, 92or:margin-top:e0px !important;:margin-bottom:e1 s !important;:margin-left: 45 s !important;"b ><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >package</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;com.zyg.security.md5;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;java.io.UnsupportedEncodingException;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;java.security.MessageDigest;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;java.security.NoSuchAlgorithmException;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;java.security.SecureRandom;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;java.util.Arrays;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt"b > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >class</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;MyMD5Util&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >private</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >finap</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp; >sta&nbsp;HEX_NUMS_STR=</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; paddbluegbbackground-x; paddinherit;"b >"0123456789ABCDEF"</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;"b >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >private</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;"b >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >finap</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;Integer&nbsp;SALT_LENGTH&nbsp;=&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding:192, 0plor:background-x; paddinherit;" >12</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >/**&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;将16进制字符串转换成字节数组&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;hex&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@!impor&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmar: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >public</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;hex >staToByte( >sta&nbsp;hex)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;len&nbsp;=&nbsp;(hex.length()&nbsp;/&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >2</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;result&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >28,</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[len];&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >char</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >[]&nbsp;hexChars&nbsp;=&nbsp;hex.toCharArray(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >for</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;(</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;i&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >;&nbsp;i&nbsp;&lt;&nbsp;len;&nbsp;i++)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;pos&nbsp;=&nbsp;i&nbsp;*&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >2</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result[i]&nbsp;=&nbsp;(<" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >)&nbsp;(HEX_NUMS_STR.indexOf(hexChars[pos])&nbsp;&lt;&lt;&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >4</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;HEX_NUMS_STR.indexOf(hexChars[pos&nbsp;+&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >1</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >])tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin:s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;result;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >/**</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;将指定byte数组转换成16进制字符串</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;b</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@!impor</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0px !important; padding: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp; >sta&nbsp;byteToHex >sta(</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;b)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >staBuffer&nbsp;hex >sta&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >28,</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp; >staBuffer(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >for</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;(</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >int</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;i&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >;&nbsp;i&nbsp;&lt;&nbsp;b.length;&nbsp;i++)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;hex&nbsp;=&nbsp;Integer.toHex >sta(b[i]&nbsp;&amp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >0xFF</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >if</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;(hex.length()&nbsp;==&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >1</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hex&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >'0'</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;+&nbsp;hex;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hex >sta.append(hex.toUpperCase()tK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;hex >sta.to >sta(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >/**</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;验证口令是否合法</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;password</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0 s; padding: 0 sr:border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;passwordInDb</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !important; padding: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@!impor</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0 s; padding: 0 sr:border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;NoSuchAlgorithmException</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;UnsupportedEncodingException</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0 s; padding: 0 sr:border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackg background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >boolean</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;validPassword( >sta&nbsp;password,&nbsp; >sta&nbsp;passwordInDb)&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >throws</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;NoSuchAlgorithmException,&nbsp;UnsupportedEncodingException&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将16进制字符串格式口令转换成字节数组</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;pwdInDb&nbsp;=&nbsp;hex >staToByte(passwordInDb);&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//声明盐变量</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: r:border: none; background-x; paddinherit;"b >[]&nbsp;salt&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >28,</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[SALT_LENGTH];&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将盐从数据库中保存的口令字节数组中提取出来</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.arraycopy(pwdInDb,&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >,&nbsp;salt,&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >,&nbsp;SALT_LENGTHtK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//创建消息摘要对象</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDigest&nbsp;md&nbsp;=&nbsp;MessageDigest.getInstance(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >"MD5"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将盐数据传入消息摘要对象</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md.update(salttK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将口令的数据传给消息摘要对象</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0pxr:border: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md.update(password.getBytes(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >"UTF-8"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >ttK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sr:border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//生成输入口令的消息摘要</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;digest&nbsp;=&nbsp;md.digest(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !important; padding: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//声明一个保存数据库中口令消息摘要的变量</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;digestInDb&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >28,</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight::bold;"b >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[pwdInDb.length&nbsp;-&nbsp;SALT_LENGTH];&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//取得数据库中口令的消息摘要</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.arraycopy(pwdInDb,&nbsp;SALT_LENGTH,&nbsp;digestInDb,&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0plor:background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >,&nbsp;digestInDb.lengthtK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//比较根据输入口令生成的消息摘要和数据库中消息摘要是否相同</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >if</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;(Arrays.equals(digest,&nbsp;digestInDb))&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//口令正确返回口令匹配消息</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >true</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >else</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//口令不正确返回口令不匹配消息</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sg:border: none; x; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >false</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >/**</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;获得加密后的16进制形式口令</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;password</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0pxr:border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@!impor</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0 s; padding: 0 sr:border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;NoSuchAlgorithmException</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !important; padding: 0px 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;UnsupportedEncodingException</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0px !important; padding: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" > !impo</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0 sr:paddmargin: t border: nonet x; padding: 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >static</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >&nbsp; >sta&nbsp;getEncryptedPwd( >sta&nbsp;password)&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >throws</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;NoSuchAlgorithmException,&nbsp;UnsupportedEncodingException&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidr:border-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//声明加密后的口令数组变量</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight::bold;"b >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;pwd&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >null</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//随机数生成器</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmarginpx 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SecureRandom&nbsp;random&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >new</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;SecureRandom(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !important; padding: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//声明盐数组变量</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;salt&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >new</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[SALT_LENGTH];&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将随机数放入盐变量中</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;random.nextBytes(salttK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !important; padding: 0 s 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin:x 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//声明消息摘要对象</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDigest&nbsp;md&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >null</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//创建消息摘要</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md&nbsp;=&nbsp;MessageDigest.getInstance(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >"MD5"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >t;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将盐数据传入消息摘要对象</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md.update(salttK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将口令的数据传给消息摘要对象</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx;lor: blackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md.update(password.getBytes(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >"UTF-8"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;"b >ttK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//获得消息摘要的字节数组</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[]&nbsp;digest&nbsp;=&nbsp;md.digest(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//因为要在口令的字节数组中存放盐,所以加上盐的字节长度</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pwd&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >new</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight::bold;" >byte</" ><" >style="margin: 0 sr:paddmargin: t border: nonet background-x; paddinherit;" >[digest.length&nbsp;+&nbsp;SALT_LENGTH];&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit;bline-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将盐的字节拷贝到生成的加密口令字节数组的前12个字节,以便在验证口令时取出盐</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.arraycopy(salt,&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0p0); background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >,&nbsp;pwd,&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0p0); background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >,&nbsp;SALT_LENGTHtK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将消息摘要拷贝到加密口令字节数组从第13个字节开始的字节</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:padding: 0px 3px 0px 10px !important;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.arraycopy(digest,&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb(192, 0p0); background-x; paddinherit;" >0</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >,&nbsp;pwd,&nbsp;SALT_LENGTH,&nbsp;digest.lengthtK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//将字节数组格式加密后的口令转化为16进制字符串格式的口令</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >!impor</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;byteToHex >sta(pwdtK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >}&nbsp;&nbsp;</" ></li></ol></div><p></p><p align="left" style="margin: 0cm 0cm 0pt; font-family: Arial; font-size: 14pxr:line-height::26pxr" >&nbsp;</p><p align="left" style="margin: 0cm 0cm 0pt; font-family: Arial; font-size: 14pxr:line-height::26pxr" ><" >style="font-size: 12pt; x; paddrgb( 0p176, 80); font-family: 宋体r" >测试类——Client,代码如下:</" ></p><p align="left" style="margin: 0cm 0cm 0pt; font-family: Arial; font-size: 14pxr:line-height::26pxr" ><" >style="font-size: 12pt; x; paddrgb( 0p176, 80); font-family: 宋体r" ><" >style="font-size: 12pt;" ></" ></" ></p><div style="font-family: Consolas, 'Courier New', Courier, mono, serif; background-x; paddrgb(231, 229, 220); width: 936.53125pxr:overflow: auto; padding-top: 1pxr:margin: 18px 0px !important;" ><div style="font-size: 12pxr:padding-left: 45pxr" ><div style="padding: 3px 8px 10px 10px; font-size: 9px; line-height::normal; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; x; paddsilver; background-x; paddrgb(248, 248, 248); border-left-width: 3pxr:border-left-style: solidr:border-left-x; paddrgb(108, 226, 108);" ><b>[java]</b>&nbsp;<a title="view plain" class="ViewSource" rel="nofollow" href="http://blog.csdn.net/m_changgong/article/details/4361526#" >view plain</a><a title="copy" class="CopyToClipboard" rel="nofollow" href="http://blog.csdn.net/m_changgong/article/details/4361526#" >copy</a><div style="position:inherit; left: 438px; top: 2936px; width: 18pxr:height::18pxr" ></div></div></div><ol start="1" style="font-size: 12px; border: none; list-style-position: initial; list-style-image: initial; background-x; paddrgb(255, 255, 255); x; paddrgb(92, 92, 92); margin-top: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;" ><li style="border-style: none none none solidr:border-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >package</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;com.zyg.security.md5;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;java.io.UnsupportedEncodingException;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;java.security.NoSuchAlgorithmException;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0px; border: none; x; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;java.util.HashMap;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >import</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;java.util.Map;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >public</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >class</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;Client&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >private</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >static</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;Map&nbsp;users&nbsp;=&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >new</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;HashMap(tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit; font-weight::bold;" >public</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >static</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >void</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;main( >sta[]&nbsp;args){&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;userName&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"zyg"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;password&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"123"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;registerUser(userName,passwordtK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userName&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"changong"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"456"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;registerUser(userName,passwordtK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;loginUserId&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"zyg"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidr:border-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;pwd&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"1232"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sg border: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >try</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >if</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >(loginValid(loginUserId,pwdt){&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >"欢迎登陆!!!"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >else</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddbluegbbackground-x; paddinherit;"b >"口令错误,请重新输入!!!"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3px; border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !importantr:padding: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >catch</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;(NoSuchAlgorithmException&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//&nbsp;TODO&nbsp;Auto-generated&nbsp;catch&nbsp;block</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsantr:padding: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace(tK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >catch</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;(UnsupportedEncodingException&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//&nbsp;TODO&nbsp;Auto-generated&nbsp;catch&nbsp;block</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace(tK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >/**</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;注册用户</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;userName</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;password</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >public</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >static</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153r; background-x; paddinherit; font-weight::bold;" >void</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;registerUser( >sta&nbsp;userName, >sta&nbsp;password){&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;encryptedPwd&nbsp;=&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >null</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0px !important;:padding: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >try</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3px; border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;encryptedPwd&nbsp;=&nbsp;MyMD5Util.getEncryptedPwd(password);&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;users.put(userName,&nbsp;encryptedPwdtK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !importantr:padding: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: boldt" >catch</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;(NoSuchAlgorithmException&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidr:border-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; x; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//&nbsp;TODO&nbsp;Auto-generated&nbsp;catch&nbsp;block</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidr:border-left-width: 3pxr:border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace(tK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >catch</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;(UnsupportedEncodingException&nbsp;e)&nbsp;{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//&nbsp;TODO&nbsp;Auto-generated&nbsp;catch&nbsp;block</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargi0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace(tK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >/**</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sg border-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;验证登陆</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmag: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;userName</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;password</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;UnsupportedEncodingException&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0px; padding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@throws&nbsp;NoSuchAlgorithmException&nbsp;</" >&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b ><" >style="margin: 0pxgbpadding: 0px; border: none; x; paddrgb( 0p13 0plor:background-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; paddrgb(108, 226, 108); list-style: decimal-leading-zero outside; background-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >public</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153rgbbackground-x; paddinherit;bfont-weight: bold;"b >static</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p1020p153r; background-x; paddinherit; font-weight::bold;" >boole </" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;loginValid( >sta&nbsp;userName, >sta&nbsp;password)&nbsp;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !importantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >throws</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;NoSuchAlgorithmException,&nbsp;UnsupportedEncodingException{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; >sta&nbsp;pwdInDb&nbsp;=&nbsp;( >sta)users.get(userNametK&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !importantr:padding: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >if</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >(</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >null</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >!=pwdInDb){&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p13 0plor:background-x; paddinherit;"b >//&nbsp;该用户存在</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >return</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;MyMD5Util.validPassword(password,&nbsp;pwdInDb);&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsantr" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >else</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >{&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblue; background-x; paddinherit;" >"不存在该用户!!!"</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >tK&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >return</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >&nbsp;</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddrgb( 0p102, 153); background-x; paddinherit; font-weight::bold;" >false</" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbbackground-x; paddinherit;" >;&nbsp;&nbsp;</" ></" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbx; paddinherit; line-height::18pxr:margin: 0 s !importantr:padding: 0px 3px 0px 10px !important;" ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</" ></li><li style="border-style: none none none solidgbborder-left-width: 3 sgbborder-left-x; padding:108, 226, 108or:list-style:e imal-leading-zero outsidegbbackground-x; paddrgb(248, 248, 248or:line-height: 18pxr:margin: 0 s !imporsant;:paddmargin: 3 s 0 s 10 s !imporsant;"b ><" >style="margin: 0pxgbpadding: 0 sgbborder: nonegbx; paddblackgbbackground-x; paddinherit;"b >} &nbsp;</" ></li></ol><div style="font-size: 12px;" ><br></div><h1 style="margin: 20px 0px 10px;:padding: 0px; border-bottom-width: 1px;:border-bottom-style: solid;:border-bottom-x; paddrgb(221, 221, 221); font-family: Verdana, Arial, Helvetica, sans-serif; background-x; paddrgb(255, 255, 255tK" ><font size="3" style="font-weight::normalK" >四,<a id="cb_post_title_url" style="margin: 0px;:padding: 0px; text-decoration: none; x; paddrgb(0, 0, 0tK" rel="nofollow" href="http://www.cnblogs.com/liubin0509/archive/2012/01/29/2331066.html" >BASE64,MD5,SHA,HMAC加密與解密算法(java)</a>:</font></h1><div><div style="margin: 0px;:padding: 0px; cle r::both; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height::19px;:background-x; paddrgb(255, 255, 255tK" ></div><div style="margin: 0px;:padding: 0px; color::rgb(17, 17, 17); font-size: 13px; line-height::1.8; font-family: Verdana, Arial, Helvetica, sans-serif; background-x; paddrgb(255, 255, 255tK" ><div id="cnblogs_post_body" style="margin: 0px 0px 20px;:padding: 0px;" ><div style="margin: 5px 0px;:padding: 5px; background-x; paddrgb(245, 245, 245); border: 1px solid:rgb(204, 204, 204); overflow: auto; x; paddrgb(0, 0, 0tK font-family: 'Courier New' !important;:font-size: 12px !important;" ><div style="margin: 5px 0px 0px;:padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s 5px 0px 0px;:line-height::1.5 !important;" ><a title="&#22797;&#21046;&#20195;&#30721;" style="margin: 0px;:padding: 0px; text-decoration: underline; x; paddrgb(0, 102, 204); border: none !important;" rel="nofollow" ><img title="搜集的几个常用的加密Java代码工具类 - 刘佳翰 - 刘小龙" src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="margin: 0px;:padding: 0px; border-style: none !important;" ></a></" ></div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-" ce: pre-wrap; word-wrap::break-word; font-family: 'Courier New' !important;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 1</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" > ckage</" > com.ice.webos.util.security;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 2</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 3</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > java.io.UnsupportedEncodingException;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 4</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > java.math.BigInteger;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 5</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > java.security.Key;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 6</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > java.security.MessageDigest;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 7</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > java.security.SecureRandom;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 8</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 9</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.Cipher;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 10</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.KeyGenerator;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 11</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.Mac;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 12</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.SecretKey;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 13</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.SecretKeyFactory;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 14</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.spec.DESKeySpec;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 15</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > javax.crypto.spec.SecretKeySpec;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 16</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 17</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > sun.misc.BASE64Decoder;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 18</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >import</" > sun.misc.BASE64Encoder;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 19</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 20</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 21</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;ul&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 22</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;BASE64的加密解密是双向的,可以求反解。&lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 23</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;MD5、SHA以及HMAC是单向加密,任何数据加密后只会产生唯一的一个加密串,通常用来校验数据在传输过程中是否被修改。&lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 24</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;HMAC算法有一个密钥,增强了数据传输过程中的安全性,强化了算法外的不可控因素。&lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 25</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;DES DES-Data Encryption Standard,即数据加密算法。<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 26</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES算法的入口参数有三个:Key、Data、Mode。<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 27</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;ul&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 28</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;Key:8个字节共64位,是DES算法的工作密钥;&lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 29</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;Data:8个字节64位,是要被加密或被解密的数据;&lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 30</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;li&gt;Mode:DES的工作方式,有两种:加密或解密。&lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 31</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;/ul&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 32</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;/li&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 33</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;ul&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 34</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 35</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@author</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Ice_Liu<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 36</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 37</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 38</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" > ublic</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >class</" > CryptUtil {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 39</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >private</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >final</" > >sta KEY_MD5 = "MD5";<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 40</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >private</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >final</" > >sta KEY_SHA = "SHA";<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 41</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 42</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * MAC算法可选以下多种算法<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 43</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 44</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;pre&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 45</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 46</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * HmacMD5 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 47</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * HmacSHA1 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 48</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * HmacSHA256 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 49</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * HmacSHA384 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 50</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * HmacSHA512 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 51</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;/pre&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 52</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 53</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >final</" > >sta KEY_MAC = "HmacMD5";<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 54</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 55</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 56</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * BASE64解密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 57</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 58</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > key<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 59</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 60</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 61</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 62</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] decryptBASE64( >sta key) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 63</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > (<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > BASE64Decoder()).decodeBuffer(key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 64</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 65</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 66</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 67</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * BASE64 加密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 68</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 69</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > key<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; pr::rgb(0, 128, 128tK line-height::1.5 !important;" > 70</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 71</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 72</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 73</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > >sta encryptBASE64(<" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] key) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; pr::rgb(0, 128, 128tK line-height::1.5 !important;" > 74</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > (<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > BASE64Encoder()).encodeBuffer(key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 75</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 76</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 77</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0px;:padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 78</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * MD5加密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 79</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 80</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > data<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 81</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x;lor::rgb(0, 128, 128tK line-height::1.5 !important;" > 82</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 83</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 84</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] encryptMD5(<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] data) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 85</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 86</" > MessageDigest md5 = MessageDigest.getInstance(KEY_MD5);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 87</" > md5.update(data);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 88</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 89</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > md5.digest();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" > 90</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 91</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 92</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 93</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 94</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * SHA加密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 95</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 96</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > data<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 97</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 98</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" > 99</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >100</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] encryptSHA(<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] data) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >101</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >102</" > MessageDigest sha = MessageDigest.getInstance(KEY_SHA);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >103</" > sha.update(data);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >104</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >105</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > sha.digest();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >106</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >107</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >108</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >109</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0px;:padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >110</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * 初始化HMAC密钥<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >111</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >112</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >113</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >114</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >115</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > >sta initMacKey() <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >116</" > KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_MAC);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >117</" > SecretKey secretKey = keyGenerator.generateKey();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >118</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > encryptBASE64(secretKey.getEncoded());<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >119</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >120</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >121</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0px;:padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >122</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * HMAC 加密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >123</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >124</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > data<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >125</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > key<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >126</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >127</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128); line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >128</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >129</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] encryptHMAC(<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] data, >sta key) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >130</" > SecretKey secretKey = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > SecretKeySpec(decryptBASE64(key), KEY_MAC);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >131</" > Mac mac = Mac.getInstance(secretKey.getAlgorithm());<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >132</" > mac.init(secretKey);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >133</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > mac.doFinal(data);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >134</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >135</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >136</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0px;:padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >137</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES 算法 &lt;br&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >138</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * 可替换为以下任意一种算法,同时key值的size相应改变。<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >139</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >140</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;pre&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >141</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES key size must be equal to 56 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >142</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DESede(TripleDES) key size must be equal to 112 or 168 <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >143</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * AES key size must be equal to 128, 192 or 256,but 192 and 256 bits may not be available <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >144</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * Blowfish key size must be multiple of 8, and can only range from 32 to 448 (inclusive) <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >145</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * RC2 key size must be between 40 and 1024 bits <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >146</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * RC4(ARCFOUR) key size must be between 40 and 1024 bits <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >147</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * &lt;/pre&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >148</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >149</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >final</" > >sta ALGORITHM = "DES";<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >150</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >151</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0px;:padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >152</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES 算法转换密钥&lt;br&gt;<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >153</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >154</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > key<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >155</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >156</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >157</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >158</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >private</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > Key toKey(<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] key) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >159</" > SecretKey secretKey = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >null</" >;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >160</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >if</" > (ALGORITHM.equals("DES") || ALGORITHM.equals("DESede")) {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >161</" > DESKeySpec dks = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > DESKeySpec(key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >162</" > SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >163</" > secretKey = keyFactory.generateSecret(dks);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >164</" > } <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >else</" > {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >165</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >//</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > 当使用其他对称加密算法时,如AES、Blowfish等算法时,用下述代码替换上述三行代码</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >166</" > secretKey = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > SecretKeySpec(key, ALGORITHM);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >167</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >168</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > secretKey;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >169</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >170</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >171</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >172</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES 算法解密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >173</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >174</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > data<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >175</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > key<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >176</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >177</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >178</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >179</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] decrypt(<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] data, >sta key) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >180</" > Key k = toKey(decryptBASE64(key));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >181</" > Cipher cipher = Cipher.getInstance(ALGORITHM);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >182</" > cipher.init(Cipher.DECRYPT_MODE, k);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >183</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > cipher.doFinal(data);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >184</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >185</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >186</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >187</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES 算法加密<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >188</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >189</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > data<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >190</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > key<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >191</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >192</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >193</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >194</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] encrypt(<" >style="margin: 0pxgbpadding: 0 sgbx; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] data, >sta key) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >195</" > Key k = toKey(decryptBASE64(key));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >196</" > Cipher cipher = Cipher.getInstance(ALGORITHM);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >197</" > cipher.init(Cipher.ENCRYPT_MODE, k);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >198</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > cipher.doFinal(data);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128); line-height::1.5 !important;" >199</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >200</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >201</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0px;:padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >202</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES 算法生成密钥<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >203</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >204</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >205</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >206</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >207</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > >sta initKey() <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >208</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > initKey(<" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >null</" >);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >209</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >210</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >211</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >/**</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >212</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * DES 算法生成密钥<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >213</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * <br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; pa: rgb(0, 128, 128tK line-height::1.5 !important;" >214</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@param</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > seed<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >215</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@return</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >216</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > * </" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(128, 128, 128tK line-height::1.5 !important;" >@throws</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > Exception<br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >217</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >*/</" ><br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >218</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > >sta initKey( >sta seed) <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >throws</" > Exception {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >219</" > SecureRandom secureRandom = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >null</" >;<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >220</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >if</" > (seed != <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >null</" >) {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >221</" > secureRandom = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > SecureRandom(decryptBASE64(seed));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >222</" > } <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >else</" > {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >223</" > secureRandom = <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > SecureRandom();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >224</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >225</" > KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >226</" > kg.init(secureRandom);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >227</" > SecretKey secretKey = kg.generateKey();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >228</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >return</" > encryptBASE64(secretKey.getEncoded());<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >229</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >230</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >231</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >public</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >static</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >void</" > main( >sta[] args) {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >232</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >try</" > {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >233</" > >sta s = "阿伯才的覆盖";<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >234</" > >sta b = CryptUtil.encryptBASE64(s.getBytes("UTF-8"));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >235</" > ystem.out.println("BASE64加密后:" + b);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >236</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >byte</" >[] c = CryptUtil.decryptBASE64(b);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >237</" > ystem.out.println("BASE64解密后:" + <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > String(c, "UTF-8"));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >238</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >239</" > c = encryptMD5(s.getBytes());<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >240</" > System.out.println("MD5 加密后:" + <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > BigInteger(c).to >sta(16));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >241</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >242</" > c = encryptSHA(s.getBytes());<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >243</" > ystem.out.println("SHA 加密后:" + <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > BigInteger(c).to >sta(16));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0px; padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >244</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >245</" > tring key = initMacKey();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >246</" > System.out.println("HMAC密匙:" + key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >247</" > c = encryptHMAC(s.getBytes(), key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >248</" > System.out.println("HMAC 加密后:" + <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > BigInteger(c).to >sta(16));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0px; padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >249</" > <br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >250</" > key = initKey();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >251</" > System.out.println(ALGORITHM + "密钥:\t" + key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >252</" > c = encrypt(s.getBytes("UTF-8"), key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >253</" > ystem.out.println(ALGORITHM + " 加密后:" + <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > BigInteger(c).to >sta(16));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0px; padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >254</" > c = decrypt(c, key);<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >255</" > ystem.out.println(ALGORITHM + " 解密后:" + <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >new</" > String(c, "UTF-8"));<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0px; padding: 0px; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >256</" > } <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >catch</" > (UnsupportedEncodingException e) {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >257</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >//</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > TODO Auto-generated catch block</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >258</" > e.printStackTrace();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >259</" > } <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 0, 255); line-height::1.5 !important;" >catch</" > (Exception e) {<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >260</" > <" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" >//</" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" > TODO Auto-generated catch block</" ><" >style="margin: 0pxgbpadding: 0px; x; paddrgb(0, 128, 0tK line-height::1.5 !important;" ><br style="margin: 0px; padding: 0px;" ></" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >261</" > e.printStackTrace();<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >262</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >263</" > }<br style="margin: 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s; x; paddrgb(0, 128, 128tK line-height::1.5 !important;" >264</" > }</pre><div style="margin: 5px 0px 0px; padding: 0px;" ><" >style="margin: 0pxgbpadding: 0 s 5px 0px 0px; line-height: 1.5 !important;" ><a title="&#22797;&#21046;&#20195;&#30721;" style="margin: 0px; padding: 0px; text-decoration: underline; x; paddrgb(0, 102, 204tK border: none !important;" rel="nofollow" ><img title="搜集的几个常用的加密Java代码工具类 - 刘佳翰 - 刘小龙" src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="margin: 0px; padding: 0px; border-style: none !important;" ></a></" ></div></div><p style="margin-right: auto; margin-left: auto;" >&nbsp;</p><p style="margin-right: auto; margin-left: auto;" >&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p></div></div></div></div><p></p></div>" />
<" >style="display:none" class="f-myLikeIcons likebtn pnt pright" id="$_" Like">喜欢 <" >class="f-myLikeIcons recommendbtn pnt pright" id="$_" Recommend">推荐 <" >style="display:none" id="$_" ShowRecommend" class="pleft rdct phide"> <" >class="pleft ul fc03"><" >id="$_" RecommendCount">0<" >class="pleft iblock icn0 icn0-722 nbw-tgl1 nas-icn0fix"> <" >class="pleft iblock icn0 icn0-621 nbw-tgl0 nas-icn0fix"> <" >class="fc07"> <" >class="f-myLikeIcons reblogbtn pnt pright" id="$_" Cite">转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

我的照片书 <" class="p fc10">- 博客风格 <" class="p fc10">- 手机博客 <" class="p fc10">- 下载LOFTER APP <" >class="p fc10">-<" >class="fc08" id="$_foot_subscribe"><" class="iblock m2a icn0 icn0-919"> 订阅此博客

网易公司版权所有 ©1997-2018