static EncryptorFactory()
 {
     _registeredEncryptors = new Dictionary <string, Type>();
     foreach (string method in TableEncryptor.SupportedCiphers())
     {
         _registeredEncryptors.Add(method, typeof(TableEncryptor));
     }
     foreach (string method in PolarSSLEncryptor.SupportedCiphers())
     {
         _registeredEncryptors.Add(method, typeof(PolarSSLEncryptor));
     }
     foreach (string method in SodiumEncryptor.SupportedCiphers())
     {
         _registeredEncryptors.Add(method, typeof(SodiumEncryptor));
     }
 }
示例#2
0
 private void RunSingleRC4EncryptionThread()
 {
     try
     {
         for (int i = 0; i < 100; i++)
         {
             var random = new Random();
             IEncryptor encryptor;
             IEncryptor decryptor;
             encryptor = new PolarSSLEncryptor("rc4-md5", "barfoo!");
             decryptor = new PolarSSLEncryptor("rc4-md5", "barfoo!");
             RunEncryptionRound(encryptor, decryptor);
         }
     }
     catch
     {
         encryptionFailed = true;
         throw;
     }
 }
示例#3
0
 private void RunSinglePolarSSLEncryptionThread()
 {
     try
     {
         for (int i = 0; i < 100; i++)
         {
             IEncryptor encryptor;
             IEncryptor decryptor;
             encryptor = new PolarSSLEncryptor("aes-256-cfb", "barfoo!");
             decryptor = new PolarSSLEncryptor("aes-256-cfb", "barfoo!");
             RunEncryptionRound(encryptor, decryptor);
         }
     }
     catch
     {
         encryptionFailed = true;
         throw;
     }
 }