public ICryptoOption CloneOption() { CryptoOption retour = new CryptoOption(); retour.CryptoKeyBytes = this.CryptoKeyBytes; retour.InitializationVectorBytes = this.InitializationVectorBytes; retour.RandomStartSalt = this.RandomStartSalt; return(retour); }
public static DataAccessorCryptoContext PrepareWithAESKey(string aesKeyString) { var crypto= new Nglib.SECURITY.CRYPTO.CryptoOption() { CryptoMode = CryptoModeEnum.AES256 }; crypto.SetCryptoKey(aesKeyString); DataAccessorCryptoContext retour = new DataAccessorCryptoContext(); retour.OptionForEncrypt = crypto; retour.OptionForDecrypt = crypto; return retour; }