public class cryptogram ;
//金鑰
private static final int key=5;
/*** @param args
*/public static void main(string args) ;
char encryptcode=cryptogram.encrypt(in);
system.out.print("encryptcode-----");
for(int i=0;isystem.out.print(encryptcode[i]);
system.out.println();
char decryptcode=cryptogram.decrypt(encryptcode);
system.out.print("decryptcode-----");
for(int i=0;isystem.out.print(decryptcode[i]); }
//加密演算法
public static char encrypt(char data)
else
} return tmp; }
private static int getindex(char data)
//解密演算法
public static char decrypt(char data)
else
} return tmp; }
}
Java常見加密和解密演算法
byte hex utility class public class bytehexutils return bf.array param bytes public static string bytes2hex byte bytes return result base64 utility cl...
加密,解密演算法
private symmetricalgorithm mcsp 宣告對稱演算法變數 private const string civ mi56 4zujhy12se6yjy111a 初始化向量 private const string ckey jkhuiy9d 9i 金鑰 常量 其中civ裡面的值...
Java加密跟解密
具體事項請直接看 public static final string key md5 md5 public static byte encryp 5 byte input throws exception public static string encryp 5bybase64 byte inp...