Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echo_return_key didn't work #1

Open
NashMiao opened this issue Aug 2, 2018 · 0 comments
Open

echo_return_key didn't work #1

NashMiao opened this issue Aug 2, 2018 · 0 comments

Comments

@NashMiao
Copy link

NashMiao commented Aug 2, 2018

I add some code in the example:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


from diffiehellman.diffiehellman import DiffieHellman

alice = DiffieHellman(group=18, key_length=1024)
bob = DiffieHellman(group=18, key_length=1024)

alice.generate_public_key()  # automatically generates private key
bob.generate_public_key()

shared_key1 = alice.generate_shared_secret(bob.public_key, echo_return_key=True)
print(shared_key1)
shared_key2 = bob.generate_shared_secret(alice.public_key, echo_return_key=True)
print(shared_key2)
a = alice.shared_key
print(a)
b = bob.shared_key
print(b)

but the output are the following:

None
None
59afb911e9878441a86091d3a527a77aa4050ae7746e10a55a56ed162c0b218d
59afb911e9878441a86091d3a527a77aa4050ae7746e10a55a56ed162c0b218d

I can't find out why the return value didn't assign to the shared_key1 and shared_key2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant