zoukankan      html  css  js  c++  java
  • Js实现AES/RSA加密

    1.
    function aesEncrypt(text, secKey) {
        var key = CryptoJS.enc.Utf8.parse(secKey);
        var iv = CryptoJS.enc.Utf8.parse("0102030405060708");
        var srcs = CryptoJS.enc.Utf8.parse(text);
        var encrypted = CryptoJS.AES.encrypt(srcs, key, {
            iv: iv,
            mode: CryptoJS.mode.CBC
        });
        return encrypted.toString()
    }
    function rsaEncrypt(text, pubKey, modulus) {
        setMaxDigits(131);
        var keys = new RSAKeyPair(pubKey,"",modulus);
        var encText = encryptedString(keys, text);
        return encText
    }
    
    2.   
    
    function b(a, b) {
            var c = CryptoJS.enc.Utf8.parse(b),
                d = CryptoJS.enc.Utf8.parse("0102030405060708"),
                e = CryptoJS.enc.Utf8.parse(a),
                f = CryptoJS.AES.encrypt(e, c, {
                    iv: d,
                    mode: CryptoJS.mode.CBC
                });
            return f.toString()
        }
        function c(a, b, c) {
            var d,
                e;
            return setMaxDigits(131), d = new RSAKeyPair(b, "", c), e = encryptedString(d, a)
        }
    

      

  • 相关阅读:
    bys_tu_2016
    ciscn_2019_es_1
    jarvisoj_level5
    axb_2019_brop64
    [ZJCTF 2019]EasyHeap
    ciscn_2019_es_7
    Exp1 PC平台逆向破解 相关wp
    picoctf_2018_shellcode
    cmcc_simplerop
    axb_2019_fmt32
  • 原文地址:https://www.cnblogs.com/iChina/p/5217812.html
Copyright © 2011-2022 走看看