Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
/ DES-ECB Public archive

Алгоритм позволяет зашифровать и расшифровать сообщение с помощью DES

Notifications You must be signed in to change notification settings

Vaynbaum/DES-ECB

Repository files navigation

Cryptographic algorithm DES Electronic Code Book mode

Алгоритм позволяет зашифровать и расшифровать сообщение.


Как использовать

Вам нужно импортировать файл Cipher.h, создать экземпляр класса Cipher.

File: main.cpp

#include <ctime>
#include <iostream>
#include <cstdlib>

#include "Cipher.h"


int main()
{
   system("chcp 1251");
   srand(time(nullptr));

   Cipher cipher;
   std::cout << "Input text: ";
   std::string text;
   std::getline(std::cin, text);

   Cipher::PairTxtKey pair = cipher.Encrypt(text);
   std::cout << "Encrypted text: " << pair.txt << std::endl;

   std::string srcText = cipher.Decrypt(pair);
   std::cout << "Decrypted text: " << srcText;
}

image

About

Алгоритм позволяет зашифровать и расшифровать сообщение с помощью DES

Topics

Resources

Stars

Watchers

Forks

Languages