using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Renci.SshClient.Security; using Renci.SshClient.Tests.Properties; namespace Renci.SshClient.Tests.Security { [TestClass] public class TestCipher { [TestMethod] public void Test_Cipher_TripleDES_Connection() { var connectionInfo = new PasswordConnectionInfo(Resources.HOST, 22, Resources.USERNAME, Resources.PASSWORD); connectionInfo.Encryptions.Clear(); connectionInfo.Encryptions.Add("3des-cbc", typeof(CipherTripleDES)); using (var client = new SshClient(connectionInfo)) { client.Connect(); client.Disconnect(); } } [TestMethod] public void Test_Cipher_AES128CBC_Connection() { var connectionInfo = new PasswordConnectionInfo(Resources.HOST, 22, Resources.USERNAME, Resources.PASSWORD); connectionInfo.Encryptions.Clear(); connectionInfo.Encryptions.Add("aes128-cbc", typeof(CipherAES128CBC)); using (var client = new SshClient(connectionInfo)) { client.Connect(); client.Disconnect(); } } [TestMethod] public void Test_Cipher_AES192CBC_Connection() { var connectionInfo = new PasswordConnectionInfo(Resources.HOST, 22, Resources.USERNAME, Resources.PASSWORD); connectionInfo.Encryptions.Clear(); connectionInfo.Encryptions.Add("aes192-cbc", typeof(CipherAES192CBC)); using (var client = new SshClient(connectionInfo)) { client.Connect(); client.Disconnect(); } } [TestMethod] public void Test_Cipher_AES256CBC_Connection() { var connectionInfo = new PasswordConnectionInfo(Resources.HOST, 22, Resources.USERNAME, Resources.PASSWORD); connectionInfo.Encryptions.Clear(); connectionInfo.Encryptions.Add("aes256-cbc", typeof(CipherAES256CBC)); using (var client = new SshClient(connectionInfo)) { client.Connect(); client.Disconnect(); } } [TestMethod] public void Test_Cipher_TripleDES_Algorithm() { //var cipher = new CipherTripleDES(); //cipher.Init(); //cipher.Encrypt(); //cipher.Decrypt(); } } }