Hello Slasher320,
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
I found the second link to be the most help.
You may think that this bit of code is where your error is, but it may not be. It is very helpful to post the whole code because the error may start somewhere you are not thinking about. This also includes any header files that you wrote.
Also it is best to include the complete error message. Others may and will see things in the error message that you are not use to at the moment.
Tip: you defined
string ciphertext="";
the (="") is not necessary as the string when defined is empty and needs no initialization.
Another thing at the top of your program sometimes the order of the include files does make a difference. In this case "iostream" should be first so it will cover the header files that you do include. And if you put header files like "iostream", "string" and others in your header files, the ones that are surrounded by double quotes, they should not be there.
Since it is not there I will not mention it, but you will have a problem when you say
string ciphertext;
because it will need to be
std::string ciphertext;
to work properly. You will also need to include the header file "<string>" after "<iostream>".
Hope that helps,
Andy