Created
April 17, 2024 10:50
-
-
Save ken5scal/32909b237cf4c624ee952df57673fbaa to your computer and use it in GitHub Desktop.
decode b64 encoded aaguid in authData. credentialData
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import sys | |
def decode_and_convert_to_hex(encoded_str): | |
# Decode from Base64 to bytes | |
decoded_bytes = base64.b64decode(encoded_str) | |
# Convert bytes to hexadecimal | |
hex_string = decoded_bytes.hex() | |
aaguid = "-".join([hex_string[:8],hex_string[8:][:4],hex_string[12:][:4],hex_string[16:][:4],hex_string[20:]]) | |
# Return the hexadecimal string | |
return aaguid | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print("Usage: python script.py <base64_encoded_string>") | |
sys.exit(1) | |
encoded_input = sys.argv[1] | |
hex_output = decode_and_convert_to_hex(encoded_input) | |
print("Hexadecimal representation:", hex_output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment