예제 #1
0
 /// <summary>
 /// A message is generated by encrypting a hard coded value with the provided Master Key and 
 /// Initialization Vector.
 /// The message is then passed to the hashing function and the key used is the provided Master Key.
 /// </summary>
 public Authorization(MasterKey masterKey, byte[] initializationVector, Aes aes, HmacSha256 hmacSha256)
 {
     InitializationVector = initializationVector;
     var ciphertext = aes.Encrypt(AuthorizedMessage, masterKey.SecretKey, initializationVector);
     Hmac = hmacSha256.Compute(ciphertext, masterKey.SecretKey);
 }
예제 #2
0
 public Encryptor(Pbkdf2 pbkdf2, Aes aes)
 {
     _pbkdf2 = pbkdf2;
     _aes = aes;
 }
예제 #3
0
 /// <summary>
 /// A new message is generated by encrypting a hard coded value with the provided Master Key and random 
 /// generated Initialization Vector.
 /// The message is then passed to the hashing function and the key used is the provided Master Key.
 /// </summary>
 public Authorization(MasterKey masterKey, Aes aes, HmacSha256 hmacSha256)
     : this(masterKey, aes.GenerateInitializationVector(), aes, hmacSha256)
 {
 }