This is a encryption and decrpytion library based on Vigenere algorithm. Just import it to use it
You need
Vigenere.cpp
and alsoVigenere.h
in your folder
Vigenere.cpp
includesVigenere.h
so you just need one import statement
All is inside a namepspace called
Vigenere.cpp
Example:
#include "Vigenere.cpp"
#include <iostream>
#include <string>
#include <sstream>
int main(){
std::istringstream analyzer = std::istringstream("CRYPTOISSHORTFORCRYPTOGRAPHY");
std::string key = "abcd";
std::string result = Vigenere::cryptoStream(analyzer, key, Vigenere::MODE::ENCRYPT).str();
// result = "CSASTPKVSIQUTGQUCSASTPIUAQJB"
return 0;
}
Name | Values |
---|---|
MODE |
ENCRYPT ,DECRYPT |
CASE |
NORMAL ,LOWER , UPPER |
FLAGS |
NONE ,IGNORE_SPECIAL_CHAR |
name | returntype |
---|---|
cryptoStream |
std::ostringstream |
Parametername (of cryptoStream ) |
Type | optional |
---|---|---|
stream |
std::istringstream & |
false |
key |
std::string |
false |
modeIn |
MODE |
false |
caseIn |
CASE |
true (default: CASE::NORMAL ) |
flagsIn |
FLAGS |
true (default: FLAGS::NONE ) |
g++ -std=c++23 -I. ./testVigenere.cpp -o runTests; if ($?) { ./runTests }
g++ -std=c++23 -I. ./testVigenere.cpp -o runTests && ./runTests