Skip to content

Authentication through c# #2859

Answered by YOUR1
YOUR1 asked this question in Q&A
Mar 18, 2021 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Thanks to @charlag's links I got it to work.

Final function to generate the authverifier using Bounty Castle:

    class Crypto
    {
        public static Encoding encoding = Encoding.UTF8;
        public static byte[] SHA256(byte[] data)
        {
            Sha256Digest sha256 = new Sha256Digest();
            sha256.BlockUpdate(data, 0, data.Length);
            byte[] hash = new byte[sha256.GetDigestSize()];
            sha256.DoFinal(hash, 0);
            return hash;
        }

        public static string GenerateAuthVerifier(string password, string salt)
        {
            byte[] passwordBytes = SHA256(encoding.GetBytes(password));
            byte[] saltBytes = Convert.FromBa…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@charlag
Comment options

@YOUR1
Comment options

Comment options

You must be logged in to vote
1 reply
@charlag
Comment options

Answer selected by YOUR1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants