static EncryptorFactory() { _registeredEncryptors = new Dictionary <string, Type>(); foreach (string method in PolarSSLEncryptor.SupportedCiphers()) { _registeredEncryptors.Add(method, typeof(PolarSSLEncryptor)); } foreach (string method in SodiumEncryptor.SupportedCiphers()) { _registeredEncryptors.Add(method, typeof(SodiumEncryptor)); } }
static EncryptorFactory() { var dllPath = "libsscrypto.dll"; LoadLibrary(dllPath); _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)); } }
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!", false, false); decryptor = new PolarSSLEncryptor("rc4-md5", "barfoo!", false, false); RunEncryptionRound(encryptor, decryptor); } } catch { encryptionFailed = true; throw; } }
private void RunSinglePolarSSLEncryptionThread() { try { for (int i = 0; i < 100; i++) { IEncryptor encryptor; IEncryptor decryptor; encryptor = new PolarSSLEncryptor("aes-256-cfb", "barfoo!", false, false); decryptor = new PolarSSLEncryptor("aes-256-cfb", "barfoo!", false, false); RunEncryptionRound(encryptor, decryptor); } } catch { encryptionFailed = true; throw; } }