Code Challenge and Code Verifier Plugin

Hello,

I haven’t seen a OAuth Code Challenge and Code Verifier Plugin yet so thought I’d release mine, enjoy.

OB2 Version: 0.3.0
Author: @harryv3
Description: Generates an OAuth Code Challenge and Code Verifier

Plugin will return {codeChallenge}, {codeVerifier}

Screenshots:

Download:
https://files.catbox.moe/a49c2j.zip

1 Like

hey scamming piece of shit, how about you fuck off :rofl: :rofl: :rofl:

https://cracked.io/Thread-Scam-Report-against-user-Harry

I don’t have a VM handy to certify the legitimacy of his files.

Be cautious with download / Use, Uploader has a history.

If you want to do the same thing as this, I have node.js snippets in a thread on this forum for the exact same thing that can be easily integrated into your configs.

Again, be CAUTIOUS.

1 Like

If you don’t want to download the file, here’s my src, you can compile it yourself into a .dll.

using System;
using System.Security.Cryptography;
using System.Text;
using RuriLib.Attributes;
using RuriLib.Logging;
using RuriLib.Models.Bots;

namespace OAuthCodeParameters
{
[BlockCategory(“OAuth Code Parameters”, “Generates Code Verifier and Challenge”, “#5a138a”, “#000”)]
public static class OAuthCodeParameters
{
[Block(“Generates a Code Verifier and Code Challenge”)]
public static string GetCodeVerifierAndChallenge(BotData data)
{
var codeVerifier = GenerateCodeVerifier();
var codeChallenge = GenerateCodeChallenge(codeVerifier);

        data.Logger.LogHeader();
        data.Logger.Log($"Generated Code Verifier: {codeVerifier}", LogColors.BluePurple);
        data.Logger.Log($"Generated Code Challenge: {codeChallenge}", LogColors.BluePurple);

        return $"{codeChallenge}, {codeVerifier}";
    }

    private static string GenerateUUIDv4()
    {
        var randomBytes = new byte[16];
        
        using (var rng = RandomNumberGenerator.Create())
        {
            rng.GetBytes(randomBytes);
        }

        randomBytes[6] = (byte)((randomBytes[6] & 0x0F) | 0x40);
        randomBytes[8] = (byte)((randomBytes[8] & 0x3F) | 0x80); 

        var uuid = new Guid(randomBytes);

        return uuid.ToString("N");
    }

    private static string GenerateCodeVerifier()
    {
        return GenerateUUIDv4() + GenerateUUIDv4() + GenerateUUIDv4();
    }

    private static string GenerateCodeChallenge(string codeVerifier)
    {
        using (var sha256 = SHA256.Create())
        {
            var bytes = Encoding.UTF8.GetBytes(codeVerifier);
            var hash = sha256.ComputeHash(bytes);

            return Base64UrlEncode(hash);
        }
    }

    private static string Base64UrlEncode(byte[] input)
    {
        var output = Convert.ToBase64String(input)
            .Replace('+', '-')
            .Replace('/', '_')
            .TrimEnd('=');

        return output;
    }
}

}