Пример #1
0
        /// <summary>
        /// calculates the password verifier (v)
        /// </summary>
        /// <param name="ri">a sha1 hash of USERNAME:PASSWORD</param>
        /// <returns>true on success otherwise false if s is faulty</returns>
        public bool CalculateVerifier(string ri)
        {
            var salt    = BigIntegerExtensions.GenerateRandom(SaltByteSize);
            var saltStr = salt.ToHexString();

            return(CalculateVerifier(ri, saltStr));
        }
Пример #2
0
        /// <summary>
        /// calculates the host public ephemeral (B),  generates also a random number as host private ephemeral (b)
        /// </summary>
        public void CalculateHostPublicEphemeral()
        {
            b = BigIntegerExtensions.GenerateRandom(19);
            var gMod = g.ModPow(b, N);

            B = ((v * 3) + gMod) % N;
        }