Beispiel #1
0
        public ICryptoOption CloneOption()
        {
            CryptoOption retour = new CryptoOption();

            retour.CryptoKeyBytes            = this.CryptoKeyBytes;
            retour.InitializationVectorBytes = this.InitializationVectorBytes;
            retour.RandomStartSalt           = this.RandomStartSalt;
            return(retour);
        }
Beispiel #2
0
        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;
        }