zoukankan      html  css  js  c++  java
  • 常见的加密

    加密:在网络传输中,如果我们传输明文,会被人给截取,从而数据泄露。我们可以对他们进行加密

    加密分为2大类,对称加密和非对称加密。

    对称加密:对称加密就是加密和解密公用一个密钥。

    DES:对称加密,速度较快,适用于加密大型数据的场合。

    public class DesUtil {

    private final static String DES = "DES";
    private final static String ENCODE = "UTF-8";

    private final static byte[] ivByte= {1,2,3,4,5,6,7,8};
    // 算法名称/加密模式/填充方式
    public static final String CIPHER_ALGORITHM = "DES/CBC/PKCS5Padding";

    //主要看填充方式 PKCS5Padding PKCS7Padding 还有其他的填充方式没用过
    // public static final String CIPHER_ALGORITHM_CBC = "DES/CBC/ZerosPadding";

    public static void main(String[] args) throws Exception {
    String data="123456";
    String timeSend="1536313412";
    System.out.println(timeSend);
    String apikey="5e29f483c48848";
    String messageId="cdf5157133f64b409e69d60c4329bb72";
    String key=Md5Util.md5Hex(apikey+timeSend+messageId);
    try {
    String encrypt = encrypt(data,key);//data是要加密的数据,key是密钥。
    System.out.println(encrypt);
    System.out.println(decrypt(encrypt,key));//encrypt这个是加密过的数据,Key是密钥。
    } catch (Exception e) {
    e.printStackTrace();
    }

    }
    所以在传输过程中,我们需要把加密过后的数据和密钥一起传过去,只要是截取到密文和密钥,就可以轻松的把数据解密。

    /**
    * Description 根据键值进行加密
    * @param data
    * @param key 加密键byte数组
    * @return
    * @throws Exception
    */
    public static String encrypt(String data, String key) throws Exception {
    byte[] bt = encrypt(data.getBytes(ENCODE), key.getBytes(ENCODE));
    return new String(Base64.getEncoder().encode(bt));
    }

    /**
    * Description 根据键值进行解密
    * @param data
    * @param key 加密键byte数组
    * @return
    * @throws IOException
    * @throws Exception
    */
    public static String decrypt(String data, String key) throws IOException,
    Exception {
    if (data == null)
    return null;
    byte[] buf = Base64.getDecoder().decode(data);
    byte[] bt = decrypt(buf, key.getBytes(ENCODE));
    return new String(bt, ENCODE);
    }

    /**
    * Description 根据键值进行加密
    * @param data
    * @param key 加密键byte数组
    * @return
    * @throws Exception
    */
    private static byte[] encrypt(byte[] data, byte[] key) throws Exception {

    // 初始化向量
    IvParameterSpec iv = new IvParameterSpec(ivByte);

    // 从原始密钥数据创建DESKeySpec对象
    DESKeySpec dks = new DESKeySpec(key);

    // 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
    SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
    SecretKey secureKey = keyFactory.generateSecret(dks);

    // Cipher对象实际完成加密操作
    Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);

    // 用密钥初始化Cipher对象
    cipher.init(Cipher.ENCRYPT_MODE, secureKey, iv);

    return cipher.doFinal(data);
    }

    /**
    * Description 根据键值进行解密
    *
    * @param data
    * @param key 加密键byte数组
    * @return
    * @throws Exception
    */
    private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
    // 初始化向量
    IvParameterSpec iv = new IvParameterSpec(ivByte);

    // 从原始密钥数据创建DESKeySpec对象
    DESKeySpec dks = new DESKeySpec(key);

    // 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
    SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
    SecretKey secureKey = keyFactory.generateSecret(dks);

    // Cipher对象实际完成解密操作
    Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);

    // 用密钥初始化Cipher对象
    cipher.init(Cipher.DECRYPT_MODE, secureKey, iv);

    return cipher.doFinal(data);
    }
    }
    AES加密
    public class AESUtil {

    public static String PLAN_PASSWORD = "PLAN_PASSWORD";

    public static String encrypt(String bef_aes, String password) {
    byte[] byteContent = null;
    try {
    byteContent = bef_aes.getBytes("utf-8");
    } catch (UnsupportedEncodingException e) {
    e.printStackTrace();
    }
    return encrypt(byteContent,password);
    }
    public static String encrypt(byte[] content, String password) {
    try {
    SecretKey secretKey = getKey(password);
    byte[] enCodeFormat = secretKey.getEncoded();
    SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
    Cipher cipher = Cipher.getInstance("AES");// 创建密码器
    cipher.init(Cipher.ENCRYPT_MODE, key);// 初始化
    byte[] result = cipher.doFinal(content);
    String aft_aes = parseByte2HexStr(result);
    return aft_aes; // 加密
    } catch (NoSuchAlgorithmException e) {
    e.printStackTrace();
    } catch (NoSuchPaddingException e) {
    e.printStackTrace();
    } catch (InvalidKeyException e) {
    e.printStackTrace();
    } catch (IllegalBlockSizeException e) {
    e.printStackTrace();
    } catch (BadPaddingException e) {
    e.printStackTrace();
    }
    return null;
    }
    public static String decrypt(String aft_aes, String password) {
    try {
    byte[] content = parseHexStr2Byte(aft_aes);
    SecretKey secretKey = getKey(password);
    byte[] enCodeFormat = secretKey.getEncoded();
    SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
    Cipher cipher = Cipher.getInstance("AES");// 创建密码器
    cipher.init(Cipher.DECRYPT_MODE, key);// 初始化
    byte[] result = cipher.doFinal(content);
    String bef_aes = new String(result);
    return bef_aes; // 加密
    } catch (NoSuchAlgorithmException e) {
    e.printStackTrace();
    } catch (NoSuchPaddingException e) {
    e.printStackTrace();
    } catch (InvalidKeyException e) {
    e.printStackTrace();
    } catch (IllegalBlockSizeException e) {
    e.printStackTrace();
    } catch (BadPaddingException e) {
    e.printStackTrace();
    }
    return null;
    }
    public static String parseByte2HexStr(byte buf[]) {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < buf.length; i++) {
    String hex = Integer.toHexString(buf[i] & 0xFF);
    if (hex.length() == 1) {
    hex = '0' + hex;
    }
    sb.append(hex.toUpperCase());
    }
    return sb.toString();
    }
    public static byte[] parseHexStr2Byte(String hexStr) {
    if (hexStr.length() < 1)
    return null;
    byte[] result = new byte[hexStr.length()/2];
    for (int i = 0;i< hexStr.length()/2; i++) {
    int value = Integer.parseInt(hexStr.substring(i*2, i*2+2), 16);
    result[i] = (byte)value;
    }
    return result;
    }
    public static SecretKey getKey(String strKey) {
    try {
    KeyGenerator _generator = KeyGenerator.getInstance("AES");
    SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
    secureRandom.setSeed(strKey.getBytes());
    _generator.init(128,secureRandom);
    return _generator.generateKey();
    } catch (Exception e) {
    throw new RuntimeException("初始化密钥出现异常");
    }
    }
    }
    测试类:
    String content = "9606b072a2d54f68a873684c288df9c9|10000002";
    String password = "12345678";
    // 加密
    System.out.println("加密前:" + content);
    String str = AESUtil.encrypt(content, AESUtil.PLAN_PASSWORD);
    System.out.println("加密后:"+str);
    String s1 = AESUtil.decrypt(str, AESUtil.PLAN_PASSWORD);
    System.out.println("解密后:" +s1);

    MD5加密:
    这个加密是不可逆转的
    public final class Md5Util {

    public static String md5Hex(String data) {
    try {
    StringBuffer sb = new StringBuffer();
    MessageDigest digest = MessageDigest.getInstance("MD5");
    digest.update(data.getBytes());
    byte b[] = digest.digest();
    int i;
    for (int offset = 0; offset < b.length; offset++) {
    i = b[offset];
    if (i < 0)
    i += 256;
    if (i < 16)
    sb.append("0");
    sb.append(Integer.toHexString(i));
    }
    return sb.toString();
    } catch (NoSuchAlgorithmException e) {
    e.printStackTrace();
    }
    return null;
    }
    }

    非对称加密:就是加密和解密用到的不是同一个密钥,通常是用2个,一个是私钥一个是公钥必须配对使用,通常公钥是公开的,进行加密。私钥是不可公开
    是用做解密的。
    RSA加密,现在通常用的都是2048.
    public class RSA2048Utils {
    public static final String KEY_ALGORITHM = "RSA";
    public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
    public static final int KEY_SIZE = 2048;
    public static String PUBLIC_KEY ="publicKey";
    public static String PRIVATE_KEY = "privateKey";
    private static final int MAX_ENCRYPT_BLOCK = 245;
    private static final int MAX_DECRYPT_BLOCK = 256;

    public RSA2048Utils() {
    }

    public static Map<String, Object> genKeyPair() throws Exception {//该方法是生成一对公私钥
    KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM);
    keyPairGen.initialize(KEY_SIZE, new SecureRandom());
    KeyPair keyPair = keyPairGen.generateKeyPair();
    RSAPublicKey publicKey = (RSAPublicKey)keyPair.getPublic();
    RSAPrivateKey privateKey = (RSAPrivateKey)keyPair.getPrivate();
    Map<String, Object> keyMap = new HashMap(2);
    keyMap.put(PUBLIC_KEY, publicKey);
    keyMap.put(PRIVATE_KEY, privateKey);
    return keyMap;
    }

    public static String privateKeySign(String dataStr,String privateKey) throws Exception {
    byte[] data = (new BASE64Decoder()).decodeBuffer(dataStr);
    RSAPrivateKey privateKeyRsa = loadPrivateKey(privateKey);
    Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
    signature.initSign(privateKeyRsa);
    signature.update(data);
    return (new BASE64Encoder()).encodeBuffer(signature.sign());
    }

    public static boolean publicKeyVerify(String dataStr, String sign,String publicKey) throws Exception {
    byte[] data = (new BASE64Decoder()).decodeBuffer(dataStr);
    RSAPublicKey publicKeyRsa = loadPublicKey(publicKey);
    Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
    signature.initVerify(publicKeyRsa);
    signature.update(data);
    return signature.verify((new BASE64Decoder()).decodeBuffer(sign));
    }

    public static byte[] decryptByPrivateKey(byte[] encryptedData, RSAPrivateKey privateKeyRsa) throws Exception {
    if (privateKeyRsa == null) {
    throw new Exception("解密私钥为空,请设置");
    } else {
    try {
    Cipher cipher = Cipher.getInstance("RSA");
    cipher.init(2, privateKeyRsa);
    return partitionAlgorithm(encryptedData, cipher, MAX_DECRYPT_BLOCK);
    } catch (NoSuchAlgorithmException var3) {
    throw new Exception("无此解密算法");
    } catch (NoSuchPaddingException var4) {
    var4.printStackTrace();
    return null;
    } catch (InvalidKeyException var5) {
    throw new Exception("解密私钥非法,请检查");
    } catch (IllegalBlockSizeException var6) {
    throw new Exception("密文长度非法");
    } catch (BadPaddingException var7) {
    throw new Exception("密文数据已损坏");
    }
    }
    }

    public static byte[] decryptByPublicKey(byte[] encryptedData, RSAPublicKey publicKeyRsa) throws Exception {
    if (publicKeyRsa == null) {
    throw new Exception("解密公钥为空,请设置");
    } else {
    try {
    Cipher cipher = Cipher.getInstance("RSA");
    cipher.init(2, publicKeyRsa);
    return partitionAlgorithm(encryptedData, cipher, MAX_DECRYPT_BLOCK);
    } catch (NoSuchAlgorithmException var3) {
    throw new Exception("无此解密算法");
    } catch (NoSuchPaddingException var4) {
    var4.printStackTrace();
    return null;
    } catch (InvalidKeyException var5) {
    throw new Exception("解密公钥非法,请检查");
    } catch (IllegalBlockSizeException var6) {
    throw new Exception("密文长度非法");
    } catch (BadPaddingException var7) {
    throw new Exception("密文数据已损坏");
    }
    }
    }

    public static byte[] encryptByPublicKey(byte[] data, RSAPublicKey publicKeyRsa) throws Exception {
    if (publicKeyRsa == null) {
    throw new Exception("加密公钥为空,请设置");
    } else {
    try {
    Cipher cipher = Cipher.getInstance("RSA");
    cipher.init(1, publicKeyRsa);
    return partitionAlgorithm(data, cipher, MAX_ENCRYPT_BLOCK);
    } catch (NoSuchAlgorithmException var3) {
    throw new Exception("无此加密算法");
    } catch (NoSuchPaddingException var4) {
    var4.printStackTrace();
    return null;
    } catch (InvalidKeyException var5) {
    throw new Exception("加密公钥非法,请检查");
    } catch (IllegalBlockSizeException var6) {
    throw new Exception("明文长度非法");
    } catch (BadPaddingException var7) {
    throw new Exception("明文数据已损坏");
    }
    }
    }

    public static byte[] encryptByPrivateKey(byte[] data, RSAPrivateKey privateKeyRsa) throws Exception {
    if (privateKeyRsa == null) {
    throw new Exception("加密私钥为空,请设置");
    } else {
    try {
    Cipher cipher = Cipher.getInstance("RSA");
    cipher.init(1, privateKeyRsa);
    return partitionAlgorithm(data, cipher, MAX_ENCRYPT_BLOCK);
    } catch (NoSuchAlgorithmException var3) {
    throw new Exception("无此加密算法");
    } catch (NoSuchPaddingException var4) {
    var4.printStackTrace();
    return null;
    } catch (InvalidKeyException var5) {
    throw new Exception("加密私钥非法,请检查");
    } catch (IllegalBlockSizeException var6) {
    throw new Exception("明文长度非法");
    } catch (BadPaddingException var7) {
    throw new Exception("明文数据已损坏");
    }
    }
    }

    public static byte[] partitionAlgorithm(byte[] data, Cipher cipher, int maxBlock) throws IOException, BadPaddingException, IllegalBlockSizeException {
    int inputLen = data.length;

    try {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    Throwable var5 = null;

    byte[] var10;
    try {
    int offSet = 0;

    for(int i = 0; inputLen - offSet > 0; offSet = i * maxBlock) {
    byte[] cache;
    if (inputLen - offSet > maxBlock) {
    cache = cipher.doFinal(data, offSet, maxBlock);
    } else {
    cache = cipher.doFinal(data, offSet, inputLen - offSet);
    }

    out.write(cache, 0, cache.length);
    ++i;
    }

    byte[] encryptedData = out.toByteArray();
    var10 = encryptedData;
    } catch (Throwable var20) {
    var5 = var20;
    throw var20;
    } finally {
    if (out != null) {
    if (var5 != null) {
    try {
    out.close();
    } catch (Throwable var19) {
    var5.addSuppressed(var19);
    }
    } else {
    out.close();
    }
    }

    }

    return var10;
    } catch (IllegalBlockSizeException | IOException | BadPaddingException var22) {
    throw var22;
    }
    }

    public static String getPrivateKey(Map<String, Object> keyMap) throws Exception {
    Key key = (Key)keyMap.get(PRIVATE_KEY);
    return (new BASE64Encoder()).encodeBuffer(key.getEncoded());
    }

    public static String getPublicKey(Map<String, Object> keyMap) throws Exception {
    Key key = (Key)keyMap.get(PUBLIC_KEY);
    return (new BASE64Encoder()).encodeBuffer(key.getEncoded());
    }

    public static RSAPublicKey loadPublicKey(String publicKeyStr) throws Exception {
    try {
    BASE64Decoder base64Decoder = new BASE64Decoder();
    byte[] buffer = base64Decoder.decodeBuffer(publicKeyStr);
    KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
    X509EncodedKeySpec keySpec = new X509EncodedKeySpec(buffer);
    return (RSAPublicKey)keyFactory.generatePublic(keySpec);
    } catch (NoSuchAlgorithmException var5) {
    throw new Exception("无此算法");
    } catch (InvalidKeySpecException var6) {
    throw new Exception("公钥非法");
    } catch (IOException var7) {
    throw new Exception("公钥数据内容读取错误");
    } catch (NullPointerException var8) {
    throw new Exception("公钥数据为空");
    }
    }

    public static RSAPrivateKey loadPrivateKey(String privateKeyStr) throws Exception {
    try {
    BASE64Decoder base64Decoder = new BASE64Decoder();
    byte[] buffer = base64Decoder.decodeBuffer(privateKeyStr);
    PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(buffer);
    KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
    return (RSAPrivateKey)keyFactory.generatePrivate(keySpec);
    } catch (NoSuchAlgorithmException var5) {
    throw new Exception("无此算法");
    } catch (InvalidKeySpecException var6) {
    var6.printStackTrace();
    throw new Exception("私钥非法");
    } catch (IOException var7) {
    throw new Exception("私钥数据内容读取错误");
    } catch (NullPointerException var8) {
    throw new Exception("私钥数据为空");
    }
    }

    public static String decryptPrivateWithBase64(String base64String,String privateKey) throws Exception {
    RSAPrivateKey privateKeyRsa = loadPrivateKey(privateKey);
    byte[] binaryData = decryptByPrivateKey((new BASE64Decoder()).decodeBuffer(base64String), privateKeyRsa);
    String string = new String(binaryData);
    return string;
    }

    public static String encryptPublicWithBase64(String string,String publicKey) throws Exception {
    RSAPublicKey publicKeyRsa = loadPublicKey(publicKey);
    byte[] binaryData = encryptByPublicKey(string.getBytes("utf-8"), publicKeyRsa);
    String base64String = (new BASE64Encoder()).encodeBuffer(binaryData);
    return base64String;
    }

    public static String decryptPublicWithBase64(String base64String,String publicKey) throws Exception {
    RSAPublicKey publicKeyRsa = loadPublicKey(publicKey);
    byte[] binaryData = decryptByPublicKey((new BASE64Decoder()).decodeBuffer(base64String), publicKeyRsa);
    String string = new String(binaryData);
    return string;
    }

    public static String encryptPrivateWithBase64(String string,String privateKey) throws Exception {
    RSAPrivateKey privateKeyRsa = loadPrivateKey(privateKey);
    byte[] binaryData = encryptByPrivateKey(string.getBytes("utf-8"), privateKeyRsa);
    String base64String = (new BASE64Encoder()).encodeBuffer(binaryData);
    return base64String;
    }

    public static void main(String[] args) throws Exception {
         String publicKey = "XXXXXXXXXXXXXXXXXXXXXX";
         String data = "xxxxxxxxxxxxxxxxxxxx";
         encryptPublicWithBase64(data,publicKey);//进行公钥加密
    String private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PGS9fQTPp/1xqidr+J/2Q+2IHM5Yy8b84esNSUyExyOYIg4Gp442yS8cCZKEBb/qX/E+6UJLSEhAvZXpospJDu9+***+PLPGtUspNf5U70I8MnM9YXhPXerI=";
    System.out.println("-------->>>"+decryptPrivateWithBase64(resultData,privateKey));//进行私钥解密

    }
    }
  • 相关阅读:
    右键菜单:锁到任务栏丢失 修复
    检测到鼠标时自动禁用触摸板 (注:仅适用于个别笔记本)
    清除右键菜单CMD入口
    VBS编辑字段
    VBS创建数据表
    VBS创建数据库
    QTP操作论坛回复编辑框----webelement
    数字排序
    对应键盘的ASCII码(备忘)
    将字符串打乱输出
  • 原文地址:https://www.cnblogs.com/echo777/p/11776935.html
Copyright © 2011-2022 走看看