Beispiel #1
0
def _2user():
    # 1st user
    public, exp = _pyecc.dh1(u'p521')
    print "public:    \t%s\nexp:    \t%s" % (public, exp)
    print
    # 2nd user
    public, key, verification = _pyecc.dh2(public, u'p521')
    print "public:    \t%s\nkey:    \t%s\nverification:\t%s" % (public, key, verification)
    print
    # 1st user completing DH
    key, verification = _pyecc.dh3(public, exp, u'p521')
    print "key:    \t%s\nverification:\t%s" % (key, verification)
Beispiel #2
0
def _2user():
    # 1st user
    public, exp = _pyecc.dh1(u'p521')
    print "public:    \t%s\nexp:    \t%s" % (public, exp)
    print
    # 2nd user
    public, key, verification = _pyecc.dh2(public, u'p521')
    print "public:    \t%s\nkey:    \t%s\nverification:\t%s" % (public, key,
                                                                verification)
    print
    # 1st user completing DH
    key, verification = _pyecc.dh3(public, exp, u'p521')
    print "key:    \t%s\nverification:\t%s" % (key, verification)
Beispiel #3
0
def wrongkey():
    print "fail wrong key"
    public, exp = _pyecc.dh1(u'p521')
    public, key, verification = _pyecc.dh2('x' * len(public), u'p521')
Beispiel #4
0
def shortkey():
    print "fail short key"
    public, exp = _pyecc.dh1(u'p521')
    public, key, verification = _pyecc.dh2(public[:-1], u'p521')
Beispiel #5
0
def wrongkey():
    print "fail wrong key"
    public, exp = _pyecc.dh1(u'p521')
    public, key, verification = _pyecc.dh2('x' * len(public), u'p521')
Beispiel #6
0
def shortkey():
    print "fail short key"
    public, exp = _pyecc.dh1(u'p521')
    public, key, verification = _pyecc.dh2(public[:-1], u'p521')