First, download ez_setup.py (http://peak.telecommunity.com/dist/ez_setup.py)
Second, use the python explanation to execute it (such as open the Py file with idle, as explained by F5)
After the installation is complete, several EXE executables will be generated under the Scripts folder. (e.g., D:\Python27\Scripts directory)
Four, you can copy the previously downloaded file Rsa-3.1.1-py2.7.egg to the D:\Python27\Scripts directory, and then switch to cmd in the D:\Python27\Scripts directory, execute the egg file: Easy_ Install.exe Rsa-3.1.1-py2.7.egg
Encryption instance
Import Osimport sysimport mathdef getdatafromfile (filename): f = open (filename) n = Int (F.read (), +) print (' * ' *77 ) print (filename) print (Hex (n)) print (' * ' *77) return (n) def my_rsa_encrypt (SRC, D, n): x = POW (src, D, N) Print (' * ' *77) print ("Encrypted Data is:") print (Hex (x)) print (' * ' *77) return x def my_rsa_decrypt (src , E, n): y = Pow (src, e, n) print (' * ' *77) print ("Decrypted Data is:") print (Hex (y)) print (' * ' *77) return Y path = OS.GETCWD () #====================================fname = path + "\\Firm_N.txt" Plaintdata = Getdatafromfile ( fname) fname = path + "\\Manuf_private_d.txt" D = getdatafromfile (fname) fname = path + "\\Manuf_N.txt" N = Getdatafromfile (fn AME) EncryptedData = My_rsa_encrypt (Plaintdata, D, n) #====================================fname = path + "\\Firm_public _e.txt "Plaintdata = Getdatafromfile (fname) fname = path +" \\Manuf_private_d.txt "D = getdatafromfile (fname) fname = path +" \\Manuf_N.txt "N = GetdatafroMfile (fname) EncryptedData = My_rsa_encrypt (Plaintdata, D, N) #====================================
Python for RSA installation encryption