lynxis / keyblepy

KeyBLE python implementation
7 stars 3 forks source link

user-key #3

Open frederictobiasc opened 3 years ago

frederictobiasc commented 3 years ago

Hey and thanks for your work. When I'm trying to register, the script keyble.py fails constantly in line 61 since userkey is not set. The help states, that user-key is generated when registering, so it seems like a bug.

Any idea how to get it to work?

./keyble.py --register --user-name fred --qrdata <redacted>
Traceback (most recent call last):
  File "/home/<>/develop/keyblepy/./keyble.py", line 164, in <module>
    main()
  File "/home/<>/develop/keyblepy/./keyble.py", line 161, in main
    ui_pair(mac, args.userid, args.userkey, cardkey)
  File "/home/<>/develop/keyblepy/./keyble.py", line 61, in ui_pair
    _userkey = binascii.unhexlify(userkey)
TypeError: argument should be bytes, buffer or ASCII string, not 'NoneType'
yunnanpl commented 2 years ago

Hi, I try to switch from the "original" keyble to this, as I am more python fan (than java), and the other required "node" is not easily available any more. I started this, and everything looks clean and tidy, but I have also hard time getting it to run. I used my "keyble" registration and key to communicate, but it did not work (still the response 0x83 looked fine).

I decided to reset the lock, and re-register users. I also found the same error message as you. It might be surprising, but I just added the user-key value (which I had before, or a random one, with a correct length (like 12345678912345678912345678900000)) and it run without an issue.

Status does not give any reasonable response, but lock and unlock run without error, but the lock does not move. I will look into this later (maybe rewrite part into micropython).

schlagmichdoch commented 1 year ago

Hi @yunnanpl and @frederictobiasc,

We are in the same situation that the "original" keyble does not work anymore and we are looking for alternatives.

I will look into this later (maybe rewrite part into micropython).

Could you make this repository work in the end or what solution did you use after all?

I'd appreciate any help!

lynxis commented 1 year ago

I'm sorry I missed all the notifications. (aka too many projects). I'll try to get another lock to play around because the production setup is running at our local hackerspace @afra

One of the problems is the missing support for decrypting messages.

yunnanpl commented 1 year ago

@schlagmichdoch : I was using the "original" node release for the time being. Now unfortunately it stopped working too, so it seems to be time to switch to something more "pythonic".

lynxis commented 1 year ago

I've pushed a couple of old commits I forget. Open/Close should now work.

schlagmichdoch commented 12 months ago

so it seems to be time to switch to something more "pythonic".

Sounds good! Can you make keyblepy work to generate new credentials or does only the open/lock/unlock mechanism work? :)

lynxis commented 11 months ago

I honestly don't know. Both "should" work. If you have time to test the new commits it would be great.