mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Updated to fix errors with not clearing strings during encoding/decoding
This commit is contained in:
@@ -30,7 +30,7 @@ Autokey::~Autokey(){
|
||||
* @param key The keyword used for the cipher
|
||||
* @param input The string that you wish to encode
|
||||
*/
|
||||
void Autokey::encodeSet(std::string& key, std::string input){
|
||||
void Autokey::encodeSet(std::string key, std::string input){
|
||||
//Remove all unneccessary elements from the key
|
||||
Vigenere::setKeyword(key);
|
||||
key = Vigenere::getKeyword();
|
||||
@@ -57,10 +57,11 @@ void Autokey::encodeSet(std::string& key, std::string input){
|
||||
* @param key The keyword used for the cipher
|
||||
* @param input The string that you wish to decode
|
||||
*/
|
||||
void Autokey::decodeSet(std::string& key, std::string input){
|
||||
void Autokey::decodeSet(std::string key, std::string input){
|
||||
//Remove all unneccessary elements from the key
|
||||
Vigenere::setKeyword(key);
|
||||
//Remove all unneccessary elements from the input
|
||||
inputString = "";
|
||||
Vigenere::setInputString(input);
|
||||
}
|
||||
|
||||
@@ -133,4 +134,4 @@ std::string Autokey::decode(std::string key, std::string input){
|
||||
setInputString(input);
|
||||
decodeSet(key, input); //Decoding is a bit different because part of the key is also part of the original message
|
||||
return Autokey::decode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user