Unity C# 大文件秒加密秒解密

using System.IO;
using System.Text;
using System.Security.Cryptography;
public class Encrypt
{
   
    /// 
    /// 加密
    /// 
    public static void Encryption(string key, string readfile)
    {
   
        StartCrypto(HashKey(key), readfile, false);
    }
    /// 
    /// 解密
    /// 
    public static void Decryption(string key, string readfile)
    {
   
        StartCrypto(HashKey(key), readfile, true);
    }
    /// 
    /// 开始使用密码
    /// 
    static void StartCrypto(int key, string readfile, bool recovery)
    {
   
        if (string.IsNullOrEmpty(readfile) == false)
        {
   
            CryptoStart(key, readfile, recovery);
        }
    }
    static void CryptoStart(int key, string readfile, bool recovery)
    {
   
        if (File.Exists(readfile) == false)
        {
   

你可能感兴趣的:(u3d开发过的功能,unity,c#)