加密和解密要用同一個key
AES:
import java.util.UUID;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class DES {
private static final byte[] iv = { 1, 2, 3, 4, 5, 6, 7, 8 };
/**
*
* @param encryptString 加密内容
* @param encryptKey 加密key
* @return
* @throws Exception
*/
public static String encryptDES(String encryptString, String encryptKey)
throws Exception {
IvParameterSpec zeroIv = new IvP......
阅读全文