| 123456789101112131415161718192021222324252627282930313233343536373839 |
- //
- // System.Security.Cryptography.CryptoTools
- // Shared class for common cryptographic functionalities
- //
- // Authors:
- // Sebastien Pouliot ([email protected])
- //
- // Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
- //
- using System;
- namespace System.Security.Cryptography {
- internal class KeyBuilder {
- static private RandomNumberGenerator rng;
- static KeyBuilder ()
- {
- rng = RandomNumberGenerator.Create ();
- }
- static public byte[] Key (int size)
- {
- byte[] key = new byte [size];
- rng.GetBytes (key);
- return key;
- }
- static public byte[] IV (int size)
- {
- byte[] iv = new byte [size];
- rng.GetBytes (iv);
- return iv;
- }
- }
- }
|