?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
#!/usr/bin/python
"""RSA demonstration.
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""
from M2Crypto import RSA, EVP, Rand
msg="The magic words are squeamish ossifrage."
sha1=EVP.MessageDigest('sha1')
sha1.update(msg)
dgst=sha1.digest()
priv=RSA.load_key('rsa.priv.pem')
pub=RSA.load_pub_key('rsa.pub.pem')
def test_encrypt(padding):
print 'testing public-key encryption:', padding
padding=eval('RSA.'+padding)
ctxt=pub.public_encrypt(dgst, padding)
ptxt=priv.private_decrypt(ctxt, padding)
if ptxt!=dgst:
print 'public_encrypt -> private_decrypt: not ok'
def test_sign(padding):
print 'testing private-key signing:', padding
padding=eval('RSA.'+padding)
ctxt=priv.private_encrypt(dgst, padding)
ptxt=pub.public_decrypt(ctxt, padding)
if ptxt!=dgst:
print 'private_decrypt -> public_encrypt: not ok'
def test0():
print 'testing misc.'
print `pub.e`, `pub.n`
print `priv.e`, `priv.n`
if __name__=='__main__':
Rand.load_file('randpool.dat', -1)
test_encrypt('pkcs1_padding')
test_encrypt('pkcs1_oaep_padding')
#test_encrypt('sslv23_padding')
test_sign('pkcs1_padding')
Rand.save_file('randpool.dat')