Amido.SystemEx.IO.EncryptionUtil.GetKeyBytes C# (CSharp) Method

GetKeyBytes() public static method

public static GetKeyBytes ( string passPhrase, string saltValue, int passwordIterations, int keySize ) : byte[]
passPhrase string
saltValue string
passwordIterations int
keySize int
return byte[]
        public static byte[] GetKeyBytes(string passPhrase, string saltValue, int passwordIterations, int keySize)
        {
            Args.NotNull(saltValue, "saltValue");
            byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);

            Rfc2898DeriveBytes deriveBytes = new Rfc2898DeriveBytes(passPhrase, saltValueBytes, passwordIterations);
            return deriveBytes.GetBytes(keySize / 8);
        }