//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // // balnee // krishnib //------------------------------------------------------------------------------ namespace System.Data.SqlClient { using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Security.Cryptography; /// /// This class implements AES_256_CBC algorithm. /// internal class SqlAes256CbcAlgorithm : SqlAeadAes256CbcHmac256Algorithm { /// /// Algorithm Name /// internal new const string AlgorithmName = @"AES_256_CBC"; /// /// Initializes a new instance of SqlAes256CbcAlgorithm algorithm with a given key and encryption type /// /// /// Root encryption key from which three other keys will be derived /// /// Encryption Type, accepted values are Deterministic and Randomized. /// For Deterministic encryption, a synthetic IV will be genenrated during encryption /// For Randomized encryption, a random IV will be generated during encryption. /// /// /// Algorithm version /// internal SqlAes256CbcAlgorithm(SqlAeadAes256CbcHmac256EncryptionKey encryptionKey, SqlClientEncryptionType encryptionType, byte algorithmVersion) :base(encryptionKey, encryptionType, algorithmVersion) { } /// /// Encryption Algorithm /// Simply call the base class, indicating we don't need an authentication tag. /// /// Plaintext data to be encrypted /// Returns the ciphertext corresponding to the plaintext. internal override byte[] EncryptData(byte[] plainText) { return EncryptData(plainText, hasAuthenticationTag: false); } /// /// Decryption Algorithm /// Simply call the base class, indicating we don't have an authentication tag. /// /// /// internal override byte[] DecryptData(byte[] cipherText) { return base.DecryptData(cipherText, hasAuthenticationTag: false); } } }