i'm trying to get the hex binary (\x**) of a base64 decode result from the Local State of chrome.
When i decode the base64 of my encrypted key using
[System.Convert]::FromBase64String($local_state.os_crypt.encrypted_key)
I get an byte array, but not hex, what i want is something like base64.b64decode("BASE64_ENCODED_STRING") from the base64 module of python I don't know how to achieve this result in powershell, so if anyone could help, i would apreciate :)
My current :
$local_state=Get-Content -Path "$($env:LOCALAPPDATA)\\Google\\Chrome\\User Data\\Local State" | ConvertFrom-Json
[System.Convert]::FromBase64String($local_state.os_crypt.encrypted_key)
Exemple of difference between powershell and python: Python output : b'\x01\x00\x01' Powershell Output : 01 00 01
Using the
ConvertFrom-SecureStringcmdlet:Default (hexadcimal) output
Not sure wherefore you need this format:
Actual Bytes
Base64
Round trip
Related:
#19948Convert*-SecureStringcmdlets enhancements