Пример #1
0
        static void TestNameEncryption()
        {
            string fileName = "Обучение CRM.docx";

            Console.WriteLine("Source name: " + fileName);

            IHashService      md5            = new Md5HashService();
            IDecodingService  unicodeDecoder = new Utf8Coder();
            ICryptoService    aes            = new AesCryptoService();
            EncryptionService svc            = new EncryptionService(md5, unicodeDecoder, aes);

            svc.SetCipherData("qazqaz", "qwer");

            string ecryptedName = svc.Process(fileName, CipherDirection.Encryption, new Base64Coder(), new Utf8Coder());

            Console.WriteLine("Encrypted name: " + ecryptedName);

            string decryptedName = svc.Process(ecryptedName, CipherDirection.Decryption, new Utf8Coder(), new Base64Coder());

            Console.WriteLine("Decrypted name: " + decryptedName);
        }
Пример #2
0
 public AddMessagesCommandHandler(ISessionFactory sessionFactory, Md5HashService md5HashService)
 {
     _sessionFactory = sessionFactory;
     _md5HashService = md5HashService;
 }