diff --git a/Encryption.cpp b/Encryption.cpp index e8491c8..74c1d9d 100644 --- a/Encryption.cpp +++ b/Encryption.cpp @@ -24,11 +24,13 @@ void Encryption::encryptMessage() GenerateKeys* gk = new GenerateKeys; ioEvent.open("encryptedFile.txt", std::ios::out); + std::cout << "String to encrypt: " << message << std::endl; for (unsigned short indexOfString = 0; indexOfString < message.size(); indexOfString++) { ioEvent << gk->encryptedCharacters[message.at(indexOfString)]; + //std::cout << gk->encryptedCharacters[message.at(indexOfString)] << std::endl; encryptedMessage += std::to_string(gk->encryptedCharacters[message.at(indexOfString)]); - std::cout << encryptedMessage << std::endl; + //std::cout << encryptedMessage << std::endl; } setEncryptedMessage(encryptedMessage); diff --git a/GenerateKeys.cpp b/GenerateKeys.cpp index d30aa6a..4be3c60 100644 --- a/GenerateKeys.cpp +++ b/GenerateKeys.cpp @@ -21,8 +21,10 @@ void GenerateKeys::populateDecryptedValues() //std::cout << decryptedCharacters[number] << " "; } } + decryptedCharacters[32] = (char) 32; //std::cout << std::endl; - decryptedCharacters[whiteSpaceCharacter] = ' '; + //decryptedCharacters[whiteSpaceCharacter] = ' '; + //std::cout << "Whitespace character" << decryptedCharacters[whiteSpaceCharacter] << "d" << std::endl; } void GenerateKeys::populateEncryptedValues() { @@ -31,6 +33,7 @@ void GenerateKeys::populateEncryptedValues() encryptedCharacters[decryptedCharacters[key]] = key; //std::cout << encryptedCharacters[decryptedCharacters[key]] << " "; } - encryptedCharacters[decryptedCharacters[startingCharacter]] = startingCharacter; + encryptedCharacters[(char) 32] = 32; + //encryptedCharacters[decryptedCharacters[startingCharacter]] = startingCharacter; //std::cout << std::endl; }