Esempio n. 1
0
        public void InsertWithAESEncryption(string title, string body, string encryptionKey)
        {
            ContentEntity content = new ContentEntity()
            {
                Title = title, Body = body
            };
            EncryptionModel encryptionModel = new EncryptionModel();

            content = encryptionModel.AES_EncryptContentEntity(content, encryptionKey);
            db.Insert(content);
        }
Esempio n. 2
0
        public void EncryptAll()
        {
            var             query           = SelectAll().ToArray();
            EncryptionModel encryptionModel = new EncryptionModel();

            for (int i = 0; i < query.Count(); i++)
            {
                ContentEntity cryptedObj;
                cryptedObj = encryptionModel.AES_EncryptContentEntity(query[i], "OnurCryptKey000000000000");
                if (cryptedObj != null)
                {
                    Update(cryptedObj);
                }
            }
        }