Beispiel #1
0
        public void FileEncrypt(string fileNameSrc, string fileNameDes)
        {
            string plainStr     = reader.Read(fileNameSrc);
            string encryptedStr = cipher.Encrypt(plainStr);

            writer.Write(encryptedStr, fileNameDes);
        }
Beispiel #2
0
        public void FileEncrypt(string srcfilepath, string desfilepath)
        {
            var plain   = reader.Read(srcfilepath);
            var encrypt = cipher.Encrypt(plain);

            writer.Write(encrypt, desfilepath);
        }
        public void FileEncrypt(string path)
        {
            string text1 = myFileReader.read(path);
            string text2 = mycCipherMachine.Encrypt(text1);

            myFileWrite.Write(path, text2);
        }
Beispiel #4
0
        public override void EncryptFile(string filePath)
        {
            string text = _reader.Read(filePath);

            text = _cipherMachine.Encrypt(text);

            _writer.Write(Path.GetFileNameWithoutExtension(filePath) + "_encrypted.txt", text);
            Console.WriteLine("Encrypt successed. Encrypted Content:{0}", text);
        }
Beispiel #5
0
 public override string DataEncrypt(string data)
 {
     return(cipher.Encrypt(data));
 }