-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cannot decrypt Message instances inside ez_cli.py. #19
Comments
There seems to be a problem with how I create the user instances. For instance, I cannot reproduce the test_message.py inside ez_p2p.py, and when I try to use the Bob & Alice instances the Userdatabase gets corrupted and nosetests fail. |
OK. I found the problem. Instead of using the eu.user_database i created an instance in ez_user_methods. Retrieving and adding users was just working fine, however, there seems to be a problem with retrieving the public key. Is this a bug? I mean it should be possible to have two working user databases at the same time. |
I would guess that this is related to the fact how you use databases. Have a look at your working directory and what database files are created. I don't think it is possible to open the same database file and write to it from two sides. Different working user databases should be no problem. |
I did not open the same database. Mine were initiated as follows:
Right now, when I run the test, i open the !same! database like three times. One time when including ez_users.py and twice when starting two ez_cli.py and I don't run into problems. And I stress that the problem was not retrieving or storing userinformation, but somehow the public/private keys were not properly initiated. |
File "ez_cli.py", line 731, in received_output |
The bug seems to appear only when a user is created for the first time. Exchanging keys and trying to decrypt a msg fails. The problem seems to be pretty similar to what I posted two weeks ago. |
I'm investigating... |
Do not focus too hard on this issue. It might no longer show up after the UID fix. |
Cannot reproduce. At least not with the original description. Does it work now? |
I ran tests locally and the problem did not show up again. However, we should test it remotely with the tracker where the problem showed up every time the public and private keys have been generated for the first time. |
I will try to see what happens when I remove the Alice and Bob keys... |
Im sending a message from Bob to Alice. The information of recipient etc is transmit well, however, I get the following error when I try to
clear_text()
File "ez_cli.py", line 635, in received_output
reply.data.clear_text()
File "/home/nick/eZchat/ez_message.py", line 54, in clear_text
clear_dict = ec.eZ_CryptoScheme(crypt_dict).decrypt_verify()
File "/home/nick/eZchat/ez_crypto.py", line 86, in decrypt_verify
_aes_output = eZ_AES(_aes_input).decrypt()
File "/home/nick/eZchat/ez_crypto.py", line 233, in decrypt
_key = self.key.decode('base64')
AttributeError: 'NoneType' object has no attribute 'decode'
Is the private is not found?
You can reproduce the error as follows:
start the server via:
python ez_server "" 1234
start two clients via:
python ez_cli.py Alice
python ez_cli.py Bob
connect one client to the server (now in ez_cli)
In Alice
:connect 127.0.0.1 1234
add server to Bob
In Bob
:add server 127.0.0.1 1234
request connection
In Bob
:ips server
now Alice and Bob are connected
send a msg from Bob to Alice
In Bob
:send Alice Hi
The text was updated successfully, but these errors were encountered: