コード例 #1
0
ファイル: SRP6Client.cs プロジェクト: mjsir911/Disa-XMPP
        /**
         * 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);
        }
コード例 #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));
        }