Esempio n. 1
0
 /// <summary>
 /// Creates the CryptoServiceProvider based on the PBKDF2.
 /// </summary>
 /// <param name="inPBKDF2">Input PBKDF2</param>
 /// <returns>CSP</returns>
 private System.Security.Cryptography.AesCryptoServiceProvider createCSP(System.Security.Cryptography.Rfc2898DeriveBytes inPBKDF2)
 {
     inPBKDF2.Reset();
     csp         = new System.Security.Cryptography.AesCryptoServiceProvider();
     csp.Mode    = this.cipherMode;
     csp.Padding = this.paddingMode;
     csp.Key     = inPBKDF2.GetBytes(csp.KeySize / 8);
     csp.IV      = inPBKDF2.GetBytes(csp.BlockSize / 8);
     return(csp);
 }