Sha256Base64EncodedHash

data.ExecutingBlock("Hash String");
string hashStringOutput = HashString(data, "CQ4318BoUIyeBcUq85LG2hjISLts_zndlMOfV8GweYu", RuriLib.Functions.Crypto.HashFunction.SHA256);
data.LogVariableAssignment(nameof(hashStringOutput));

// BLOCK: Hex => Bytes
data.ExecutingBlock("Hex => Bytes");
byte[] hexStringToByteArrayOutput = HexStringToByteArray(data, $"{hashStringOutput}", true);
data.LogVariableAssignment(nameof(hexStringToByteArrayOutput));

// BLOCK: Bytes => Base64
data.ExecutingBlock("Bytes => Base64");
string byteArrayToBase64StringOutput = ByteArrayToBase64String(data, hexStringToByteArrayOutput.AsBytes(), true);
data.LogVariableAssignment(nameof(byteArrayToBase64StringOutput));

Here, I am basically just hashing a string in sha 256 and converting the hex → bytes then bytes → base64 considering I can’t just do hex → base64 in OB2 and then I url encoded that base64 encoded output.

Anyway way possible I can reverse the “base64 encoded output” and get the plain text again being “CQ4318BoUIyeBcUq85LG2hjISLts_zndlMOfV8GweYu”

There should be a Base64 => Bytes block no? If it’s URL encoded then I guess just URL Decode it first.

Idk, I don’t think I can recover the plain text value of the code_verifier considering its a sha256 hash once its converted from a url encoded string to base 64 then base 64 to bytes!

Ah I thought you wanted to go from base64 back to hex. Well yeah of course you cannot “unhash” something :sweat_smile: Didn’t read the whole question