This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public const int KEY_SIZE = 16; | |
public byte[] Encrypt (string password, string input) | |
{ | |
var sha256CryptoServiceProvider = new SHA256CryptoServiceProvider(); | |
var hash = sha256CryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(password)); | |
var key = new byte[KEY_SIZE]; | |
var iv = new byte[KEY_SIZE]; | |
Buffer.BlockCopy(hash, 0, key, 0, KEY_SIZE); |