Пример #1
0
        /// <summary>
        /// A static publicly exposed version of GetDerivedKeyBytes_PBKDF2_HMACSHA512 which matches the exact specification in Rfc2898 PBKDF2 using HMACSHA512
        /// </summary>
        /// <param name="P">Password passed as a Byte Array</param>
        /// <param name="S">Salt passed as a Byte Array</param>
        /// <param name="c">Iterations to perform the underlying PRF over</param>
        /// <param name="dkLen">Length of Bytes to return, an AES 256 key wold require 32 Bytes</param>
        /// <returns>Derived Key in Byte Array form ready for use by chosen encryption function</returns>
        public static byte[] PBKDF2(byte[] P, byte[] S, int c, int dkLen)
        {
            var rfcObj = new Rfc2898(P, S, c);

            return(rfcObj.GetDerivedKeyBytes_PBKDF2_HMACSHA512(dkLen));
        }
Пример #2
0
 /// <summary>
 /// A static publicly exposed version of GetDerivedKeyBytes_PBKDF2_HMACSHA512 which matches the exact specification in Rfc2898 PBKDF2 using HMACSHA512
 /// </summary>
 /// <param name="P">Password passed as a Byte Array</param>
 /// <param name="S">Salt passed as a Byte Array</param>
 /// <param name="c">Iterations to perform the underlying PRF over</param>
 /// <param name="dkLen">Length of Bytes to return, an AES 256 key wold require 32 Bytes</param>
 /// <returns>Derived Key in Byte Array form ready for use by chosen encryption function</returns>
 public static Byte[] PBKDF2 (Byte[] P, Byte[] S, Int32 c, Int32 dkLen)
 {
     Rfc2898 rfcObj = new Rfc2898(P, S, c);
     return rfcObj.GetDerivedKeyBytes_PBKDF2_HMACSHA512(dkLen);
 }
Пример #3
0
        /// <summary>
        /// A static publicly exposed version of GetDerivedKeyBytes_PBKDF2_HMACSHA512 which matches the exact specification in Rfc2898 PBKDF2 using HMACSHA512
        /// </summary>
        /// <param name="P">Password passed as a Byte Array</param>
        /// <param name="S">Salt passed as a Byte Array</param>
        /// <param name="c">Iterations to perform the underlying PRF over</param>
        /// <param name="dkLen">Length of Bytes to return, an AES 256 key wold require 32 Bytes</param>
        /// <returns>Derived Key in Byte Array form ready for use by chosen encryption function</returns>
        public static Byte[] PBKDF2(Byte[] P, Byte[] S, Int32 c, Int32 dkLen)
        {
            Rfc2898 rfcObj = new Rfc2898(P, S, c);

            return(rfcObj.GetDerivedKeyBytes_PBKDF2_HMACSHA512(dkLen));
        }