Beispiel #1
0
        public void DecryptFile(string encryptedFilePath, string filePath, string password)
        {
            byte[] bytesToBeDecrypted = File.ReadAllBytes(encryptedFilePath);
            byte[] passwordBytes      = Encoding.UTF8.GetBytes(password);
            passwordBytes = SHA256.Create().ComputeHash(passwordBytes);

            byte[] bytesDecrypted = _aesHelper.AES_Decrypt(bytesToBeDecrypted, passwordBytes);

            File.WriteAllBytes(filePath, bytesDecrypted);
        }