Example #1
0
 /// <summary>
 ///     Constructs a HMACSHA256Cng object with a randomly generated key, which will use the Microsoft
 ///     PrimitiveAlgorithm Provider to do its work.
 /// </summary>
 public HMACSHA256Cng() : this(RNGCng.GenerateKey(BlockSize))
 {
 }
Example #2
0
 public override void GenerateIV()
 {
     // Both GCM and CCM work well with 12 byte nonces, so use that by default.
     IVValue = RNGCng.GenerateKey(12);
 }
Example #3
0
 public override void GenerateKey()
 {
     KeyValue = RNGCng.GenerateKey(KeySizeValue / 8);
 }
 public override void GenerateIV()
 {
     IVValue = RNGCng.GenerateKey(BlockSizeValue / 8);
 }