Issue #1 #2 #4 are addressed in this commit. Added another window with controls for key management. Simple ASCII encryption
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "Encryption.h"
|
||||
#include "GenerateKeys.h"
|
||||
@@ -13,6 +15,10 @@ Encryption::Encryption(const std::string& message)
|
||||
}
|
||||
|
||||
|
||||
void Encryption::setEncryptedMessage(const std::string& encryptedMessage)
|
||||
{
|
||||
this->encryptedMessage = encryptedMessage;
|
||||
}
|
||||
void Encryption::encryptMessage()
|
||||
{
|
||||
GenerateKeys* gk = new GenerateKeys;
|
||||
@@ -21,9 +27,18 @@ void Encryption::encryptMessage()
|
||||
for (unsigned short indexOfString = 0; indexOfString < message.size(); indexOfString++)
|
||||
{
|
||||
ioEvent << gk->encryptedCharacters[message.at(indexOfString)];
|
||||
encryptedMessage += std::to_string(gk->encryptedCharacters[message.at(indexOfString)]);
|
||||
std::cout << encryptedMessage << std::endl;
|
||||
}
|
||||
|
||||
setEncryptedMessage(encryptedMessage);
|
||||
ioEvent.close();
|
||||
|
||||
delete gk;
|
||||
}
|
||||
|
||||
|
||||
std::string Encryption::getEncryptedMessage() const
|
||||
{
|
||||
return encryptedMessage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user