KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21571/root/usr/share/doc/m2crypto-0.16/demo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21571/root/usr/share/doc/m2crypto-0.16/demo/dhtest.py
#!/usr/bin/python

"""DH demonstration.

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""

from M2Crypto import DH, Rand

def test():
    print 'generating dh params:'
    a = DH.gen_params(128, 2)
    b = DH.set_params(a.p, a.g)
    a.gen_key()
    b.gen_key()
    print 'p = ', `a.p`
    print 'g = ', `a.g`
    print 'a.pub =', `a.pub`
    print 'a.priv =', `a.priv`
    print 'b.pub =', `b.pub`
    print 'b.priv =', `b.priv`
    print 'a.key = ', `a.compute_key(b.pub)`
    print 'b.key = ', `b.compute_key(a.pub)`

if __name__=='__main__':
    Rand.load_file('randpool.dat', -1) 
    test()
    Rand.save_file('randpool.dat')

Anon7 - 2021