mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Fixed to work correctly with new Vigenere class functions
This commit is contained in:
@@ -48,6 +48,7 @@ void Autokey::encodeSet(std::string key, std::string input){
|
||||
//Set the new Keyword
|
||||
keyword = key;
|
||||
//Make sure to update the offset
|
||||
offset.clear();
|
||||
setOffset();
|
||||
}
|
||||
|
||||
@@ -78,6 +79,7 @@ std::string Autokey::decode(){
|
||||
std::string key = keyword;
|
||||
unsigned int keyLength = keyword.size();
|
||||
for(int cnt = 0;(key.size() * cnt) < inputString.size();++cnt){
|
||||
outputString = "";
|
||||
//Make sure you are not going to run out of bounds with the keyword
|
||||
//This also allows the key to be longer than the message
|
||||
if(keyword.size() == keyLength){
|
||||
@@ -103,6 +105,7 @@ std::string Autokey::decode(){
|
||||
output += temp;
|
||||
keyword += temp;
|
||||
//Make sure to update the offsets
|
||||
offset.clear();
|
||||
setOffset();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user