HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //proc/self/root/proc/thread-self/root/usr/share/doc/m2crypto-0.21.1/demo/ec/ecdhtest.py
#!/usr/bin/python

"""ECDH demonstration.

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

Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. 
All rights reserved."""

from M2Crypto import EC,Rand

def test():
    print 'generating ec keys:'
    a=EC.gen_params(EC.NID_sect233k1)
    a.gen_key()
    b=EC.gen_params(EC.NID_sect233k1)
    b.gen_key()
    a_shared_key = a.compute_dh_key(b.pub())
    b_shared_key = b.compute_dh_key(a.pub())
    print 'shared key according to a = ', `a_shared_key`
    print 'shared key according to b = ', `b_shared_key`
    if a_shared_key == b_shared_key:
        print 'ok'
    else:
        print 'not ok'


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