Giter Club home page Giter Club logo

trinitycore-srp6's Introduction

TrinityCore / AzerothCore SRP6

This library is used to generate the SRP6 verifier for TrinityCore (3.3.5) / AzerothCore.

Usage

To install

npm install trinitycore-srp6 --save

Import

JS module import

import { computeVerifier, params } from "trinitycore-srp6"

Common JS import

const { computeVerifier, params } = await import(`trinitycore-srp6`)

To use Commons JS with required please use version 1.0.4:

const { computeVerifier, params } = require(`trinitycore-srp6`)

Usage

Generate verifier with default values:

import { computeVerifier, params } from "trinitycore-srp6"
const myTrinityVerifier = computeVerifier(
    params.trinitycore, 
    Buffer.from(salt), 
    username, 
    password
)
const myAzerothVerifier = computeVerifier(
    params.azerothcore,
    Buffer.from(salt),
    username,
    password
)

Generate verifier with custom params

const janeDoeAccount =   {
    username: `janedoe`,
    password: `j@n3d0e`,
    salt: `25F5729D0D03D18F1528AF29F7CC83257081D8C4CA1772817C5CD36605BFB12F`,
}

const salt = Buffer.from(janeDoeAccount.salt, `hex`)
const myParam = {
    N_length_bits: 256,
    N: BigInt(`0x8A4B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7`),
    g: BigInt(`0x7`),
    hash: `sha1`
}

const myVerifier = computeVerifier(
    myParam,
    salt,
    janeDoeAccount.username,
    janeDoeAccount.password
)
const strVerifier = myVerifier.toString(`hex`).toUpperCase()

trinitycore-srp6's People

Contributors

miorey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

trinitycore-srp6's Issues

How do I authorize?

I want to make an authorization, how can I verify the password with the password in the database during authorization?

Salt generation

Hey. Thank you for this creator. I spent ours trying to do something similar. It appears that it would be much easier in PHP.
I am trying to implement your creator, but I cannot make it work. How do you generate the salt? I am using crypto.randomBytes(32) but it's now working. In fact I am able to write both salt and verifier to account DB, but I am not able to login (invaild password). So there must be something wrong with my implementation. Thanks for your help or any ideas.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.