Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- std::string str = "ATTACKATDAWN";
- std::string key = "LEMONLEMONLE";
- std::string result;
- int keyIndex = 0;
- char s_buffer[100];
- int i = 0;
- for (i = 0; i < str.length(); i++)
- {
- char chiphed = Vigenere(str[i], key[i]);
- (keyIndex == key.length() - 1) ? keyIndex = 0 : keyIndex++;
- s_buffer[i] = chiphed;
- }
- s_buffer[i] = 0;
- std::cout << s_buffer << std::endl;
- }
Add Comment
Please, Sign In to add comment