欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

javascript - jsencrypt 加密怎么用Python 的rsa库实现。

程序员文章站 2022-06-11 16:57:33
...

javascript - jsencrypt 加密怎么用Python 的rsa库实现。

  1. 列表项目

var encrypt = new JSEncrypt();

        encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp0wHYbg/NOPO3nzMD3dndwS0MccuMeXCHgVlGOoYyFwLdS24Im2e7YyhB0wrUsyYf0/nhzCzBK8ZC9eCWqd0aHbdgOQT6CuFQBMjbyGYvlVYU2ZP7kG9Ft6YV6oc9ambuO7nPZh+bvXH0zDKfi02prknrScAKC0XhadTHT3Al0QIDAQAB');
        var encrypted_input1 = encrypt.encrypt($('#input1').val());
        var encrypted_input2 = encrypt.encrypt($('#input2').val());
        var ajax_data = {
            input1: encrypted_input1,
            input2: encrypted_input2,
            remember: $('#remember_me').prop('checked')
        };

回复内容:

javascript - jsencrypt 加密怎么用Python 的rsa库实现。

  1. 列表项目

var encrypt = new JSEncrypt();

        encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp0wHYbg/NOPO3nzMD3dndwS0MccuMeXCHgVlGOoYyFwLdS24Im2e7YyhB0wrUsyYf0/nhzCzBK8ZC9eCWqd0aHbdgOQT6CuFQBMjbyGYvlVYU2ZP7kG9Ft6YV6oc9ambuO7nPZh+bvXH0zDKfi02prknrScAKC0XhadTHT3Al0QIDAQAB');
        var encrypted_input1 = encrypt.encrypt($('#input1').val());
        var encrypted_input2 = encrypt.encrypt($('#input2').val());
        var ajax_data = {
            input1: encrypted_input1,
            input2: encrypted_input2,
            remember: $('#remember_me').prop('checked')
        };