public CryptoService(ICryptoSettings settings) { _hashAlgorithm = SHA256.Create(); if (settings.EncryptionKey == null || settings.EncryptionKey.Length != 64) throw new ConfigurationErrorsException("CryptoService.EncryptionKey is missing in the configuration table or corrupt! It should be a 64 char length hex representation of a 32 byte array (256 bit), try redeploying the sharvrir or reimporting the schema. Key was: " + (string.IsNullOrEmpty(settings.EncryptionKey) ? "null/empty" : settings.EncryptionKey)); EncryptionKey = settings.EncryptionKey.FromHexString(); }
public CryptoService(ICryptoSettings settings) { _hashAlgorithm = SHA256.Create(); if (settings.EncryptionKey == null || settings.EncryptionKey.Length != 64) { throw new ConfigurationErrorsException("CryptoService.EncryptionKey is missing in the configuration table or corrupt! It should be a 64 char length hex representation of a 32 byte array (256 bit), try redeploying the sharvrir or reimporting the schema. Key was: " + (string.IsNullOrEmpty(settings.EncryptionKey) ? "null/empty" : settings.EncryptionKey)); } EncryptionKey = settings.EncryptionKey.FromHexString(); }
public CryptographyService(ICryptoSettings settings) { this.settings = settings; }
public Crypto(ICryptoSettings settings) { _salt = Encoding.ASCII.GetBytes(settings.Salt); _sharedSecret = settings.Secret; }
public StringEncryptor(IAlgorithmFactory algorithmFactory, ICryptoSettings settings) { this.settings = settings; this.algorithmFactory = algorithmFactory; }