The original is encrypted using Jsencrypt in HTML:
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') };
Want to use Python's library RSA to implement the same encryption:
name = ' ADAM_LBQ ' #input1
Password = ' 123456 ' #input2
My implementation code is as follows:
Coding:utf-8
Import RSA
name = ' ADAM_LBQ '
Password = ' 123456 '
Pub_key = # How to write?
Rsa_name = Rsa.encrypt (Name,pub_key)
Rsa_password = Rsa.encrypt (Password,pub_key)
Print Rsa_name + ' \ n ' + Rsa_password
I am the analog landing to crawl content, hope is encrypted and JS encrypted content is the same, how to write ah?
Reply content:
The original is encrypted using Jsencrypt in HTML:
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') };
Want to use Python's library RSA to implement the same encryption:
name = ' ADAM_LBQ ' #input1
Password = ' 123456 ' #input2
My implementation code is as follows:
Coding:utf-8
Import RSA
name = ' ADAM_LBQ '
Password = ' 123456 '
Pub_key = # How to write?
Rsa_name = Rsa.encrypt (Name,pub_key)
Rsa_password = Rsa.encrypt (Password,pub_key)
Print Rsa_name + ' \ n ' + Rsa_password
I am the analog landing to crawl content, hope is encrypted and JS encrypted content is the same, how to write ah?
Generate a pair of RSA public keys
If Git is installed,
Open git bash, enter ssh-keygen-t RSA
All the way back to the C drive after the user directory there is a. SSH directory, in the. pub file is the public key file, which is the Pub_key
Public key encryption, the private key is used to decrypt
About python
the rsa
encryption
Pycrypto and RSA Password Technical notes