I've looked around everywhere for a C++ code that takes a message from the user, and encodes it by increasing the ASCII value of each character (obviously not very secure, but simple enough). I've managed to put together a program that returns a character of a few values higher, but can not figure out how to do it with a full message including spaces. I plan to make a decoder that does the opposite afterwards. Any help would be really appreciated. Thanks in advance.
Single Value C++ Program -
#include <iostream>
using namespace std;
int main(){
char ascii;
cout << "Enter a character: ";
cin >> ascii;
cout << "Its ascii value is: " << (int) ascii << endl;
return 0;
}
Working Encoder Example in VBS -
set x = WScript.CreateObject("WScript.Shell")
entxtde = inputbox("Enter text to be encoded")
entxtde = StrReverse(entxtde)
x.Run "%windir%\notepad"
wscript.sleep 1000
x.sendkeys encode(entxtde)
function encode(s)
For i = 1 To Len(s)
newtxt = Mid(s, i, 1)
newtxt = Chr(Asc(newtxt)+3)
coded = coded & newtxt
Next
encode = coded
End Function