I am a C# guy who is desperately trying to learn C++ and port some old code over. Been doing OK so far but the following method has me stumped. If anyone could give me some pointers (sorry for pun) I would be grateful.
C# method:
public static string crappyEncryption(String userKey)
{
StringBuilder eStr = new StringBuilder();
String key1 = "somehorriblelongstring";
String key2 = "someotherhorriblelongstring";
for (int i = 0; i < userKey.Length; i++)
{
eStr.Append(key2[key1.IndexOf(userKey[i])]);
}
return encodeTo64(eStr.ToString());
}
encodeTo64 is a local method which I have solved in C++. This weird method (if you were wondering) was a small encryption method I came up with that we could use mobile cross platform for non-essential string encryption.
Thanks very much
encodeTo64is an algorithm from Base64 family (en.wikipedia.org/wiki/Base64) then I wouldn't call it weird, it's just a way to deal with textual communications when you need to transfer binary data.