SHA-256 Encode
-
i have make a little script in python to get the base64 encode of sha256 string, after i try this in openbullet the result is very diff.
My Script:import hashlib import base64 SUP = hashlib.sha256('{"user":"[email protected]","meta":{"event":"login","store":"android","adid":"72196d1d-4027-468b-b920-9611c5daff07","platform":"1.13.2","tracking":"/"}}'.encode("UTF8")).digest() print(base64.b64encode(SUP)) OUTPUT >> b'awxY8392SBkwJmAMKkZ05Jaa8zaeGvsEflfbqnYt1vg='
But the same blocks in openbullet return: NmIwYzU4ZjM3Zjc2NDgxOTMwMjY2MDBjMmE0Njc0ZTQ5NjlhZjMzNjllMWFmYjA0N2U1N2RiYWE3NjJkZDZmOA==
-
@ManoPlayBRL Need to change digest() to hexdigest()
import hashlib import base64 SUP = hashlib.sha256(b'{"user":"[email protected]","meta":{"event":"login","store":"android","adid":"72196d1d-4027-468b-b920-9611c5daff07","platform":"1.13.2","tracking":"/"}}').hexdigest().encode('UTF8') print(base64.b64encode(SUP))
-
@Br4uN My code is correct '=' I need to transfer this to the openbullet, but it does the hexdigest without me putting it
I would need it to only do the digest...
-
@ManoPlayBRL OK here we go follow this guide to make it work
https://forum.openbullet.dev/topic/110/use-the-ironpython-standard-modules-and-load-other-modules
BEGIN SCRIPT IronPython import sys sys.path.append('./src') import hashlib import base64 SUP = hashlib.sha256('{"user":"[email protected]","meta":{"event":"login","store":"android","adid":"72196d1d-4027-468b-b920-9611c5daff07","platform":"1.13.2","tracking":"/"}}'.encode("UTF8")).digest() SUP2 = (base64.b64encode(SUP)) END SCRIPT -> VARS "SUP2"
-
@Br4uN Thank you very much for your help, but would there be any way to do this with native openbullet or Javascript functions?
-
#FUNCTION_Hash256 FUNCTION Hash SHA256 "{\"user\":\"[email protected]\",\"meta\":{\"event\":\"login\",\"store\":\"android\",\"adid\":\"72196d1d-4027-468b-b920-9611c5daff07\",\"platform\":\"1.13.2\",\"tracking\":\"/\"}}" -> VAR "data" UTILITY Conversion HEX BASE64 "<data>" -> VAR "Result"
-
@Br4uN Thxxx, I had forgotten to put the last parenthesis