Exemplo n.º 1
0
        /**
         * Generates client's credentials given the client's salt, identity and password
         * @param salt The salt used in the client's verifier.
         * @param identity The user's identity (eg. username)
         * @param password The user's password
         * @return Client's public value to send to server
         */
        public virtual BigInteger GenerateClientCredentials(byte[] salt, byte[] identity, byte[] password)
        {
            this.x     = Srp6Utilities.CalculateX(digest, N, salt, identity, password);
            this.privA = SelectPrivateValue();
            this.pubA  = g.ModPow(privA, N);

            return(pubA);
        }
Exemplo n.º 2
0
        /**
         * Creates a new SRP verifier
         * @param salt The salt to use, generally should be large and random
         * @param identity The user's identifying information (eg. username)
         * @param password The user's password
         * @return A new verifier for use in future SRP authentication
         */
        public virtual BigInteger GenerateVerifier(byte[] salt, byte[] identity, byte[] password)
        {
            BigInteger x = Srp6Utilities.CalculateX(digest, N, salt, identity, password);

            return(g.ModPow(x, N));
        }