⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cryptographer.cs

📁 g729 coding ipaddressing
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace SimpleCryptographer
{
    class Cryptographer
    {        
        CommonProcess cProcess = null;

        public Cryptographer(int algorithm_number, Form1.ProgressEventHandler IncrementProgress, Form1.ProgressInitHandler InitProgress)
        {            
            if (Algorithms.DES == algorithm_number || Algorithms.DES_File == algorithm_number)
            {
                cProcess = new DES.ProcessDES(IncrementProgress, InitProgress);
            }
            else
            {
                cProcess = new AES.ProcessAES(IncrementProgress, InitProgress);
            }
        }
        public void EncryptionStart(string filename, string EncryptedFilename, string key/*, bool IsBinary*/)
        {
            string binarytext = AES.FileIO.FileReadToBinary(filename);
            binarytext =  this.EncryptionStart(binarytext, key, true);
            AES.FileIO.WriteBinaryToFile(EncryptedFilename, binarytext);
            //return cProcess.EncryptionStart(text, key, IsBinary);
        }

        public string EncryptionStart(string text, string key, bool IsBinary)
        {            
            return cProcess.EncryptionStart(text, key, IsBinary);
        }

        public void DecryptionStart(string filename, string DecryptedFilename, string key/*, bool IsBinary*/)
        {
            string binarytext = AES.FileIO.FileReadToBinary(filename);
            binarytext = this.DecryptionStart(binarytext, key, true);
            AES.FileIO.WriteBinaryToFile(DecryptedFilename, binarytext);
            //return cProcess.DecryptionStart(text, key, IsBinary);
        }

        public string DecryptionStart(string text, string key, bool IsBinary)
        {
            return cProcess.DecryptionStart(text, key, IsBinary);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -