-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathmain_vigenere.cpp
More file actions
29 lines (23 loc) · 806 Bytes
/
main_vigenere.cpp
File metadata and controls
29 lines (23 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <string.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <ctype.h>
#include "vigenere.h"
#include "b64.h"
using namespace std;
int main() {
// Vigenere encoding
std::string msg = "HELLO WORLD";
std::string key = "THISISALONGPRIVATEKEY";
std::string encryptedMsg = encrypt_vigenere(msg, key);
std::string newKey = extend_key(msg, key);
std::string decryptedMsg = decrypt_vigenere(encryptedMsg, newKey);
std::cout << "Original Message : " << msg << std::endl;
std::cout << "Key : " << key << std::endl;
std::cout << "New Generated Key: " << newKey << std::endl;
std::cout << "Enc Vigenere Msg : " << encryptedMsg << std::endl;
std::cout << "Dec Vigenere Msg : " << decryptedMsg << std::endl;
return 0;
}