Author

Topic: how to find hexkey from checksum (Read 155 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
October 06, 2022, 07:14:38 AM
#4
hi i have been tring to find hexkey from checksum found this code but there is something wrong can any one help and do some corrections its on python

That code comes from GitHub[1], where the repository[2] is about "Python control for Leviton Decora Bluetooth switches". There's no correlation between that repository and Bitcoin cryptography.

[1] https://github.com/mjg59/python-decora/blob/master/get_key.py
[2] https://github.com/mjg59/python-decora
legendary
Activity: 3388
Merit: 3154
October 05, 2022, 03:37:47 PM
#3
hi i have been tring to find hexkey from checksum found this code but there is something wrong can any one help and do some corrections its on python


Code:
import decora
import sys
address = sys.argv[1]
switch = decora.decora(address, None)
rawkey = switch.read_key()
if rawkey == "LEVI":
 print("Switch is not in pairing mode - hold down until green light flashes\n")
 else: key = int(ord(rawkey[0])) << 24 | int(ord(rawkey[1])) << 16 | int(ord(rawkey[2])) << 8 | int(ord(rawkey[3]))
print(hex(key))

Using a Bluetooth switches software to find an hexkey from the checksum is the most random thing i have ever seen in this forum. So lets talk about python-decora:

Example use
This will connect and turn on the light
Code:
import decora

switch = decora.decora("00:21:4d:00:00:01", key="key")
switch.connect()
switch.on()
This will set the light to 50% intensity

Code:
switch.set_brightness(50)
And turn the lights off

Code:
switch.off()

Source:
https://github.com/mjg59/python-decora

If you want to learn how to encrypt or decrypt an hexkey, you can start here:
https://secretscan.org/PrivateKeyHex
legendary
Activity: 952
Merit: 1386
October 05, 2022, 09:47:25 AM
#2
hi i have been tring to find hexkey from checksum found this code but there is something wrong can any one help and do some corrections its on python

Code:
print("Switch is not in pairing mode - hold down until green light flashes\n")


Could you tell clearly what do you want to accomplish? Checksum of what? Base58 decoded address or WIF?
The code you showed does not make really any sense as is provided completely out-of-scope.
newbie
Activity: 1
Merit: 0
October 05, 2022, 07:49:00 AM
#1
hi i have been tring to find hexkey from checksum found this code but there is something wrong can any one help and do some corrections its on python


Code:
import decora
import sys
address = sys.argv[1]
switch = decora.decora(address, None)
rawkey = switch.read_key()
if rawkey == "LEVI":
 print("Switch is not in pairing mode - hold down until green light flashes\n")
 else: key = int(ord(rawkey[0])) << 24 | int(ord(rawkey[1])) << 16 | int(ord(rawkey[2])) << 8 | int(ord(rawkey[3]))
print(hex(key))
Jump to: