Programming in c#.
I’m trying to substitute every char in a string with another char (Encryption), but I need some help. I was going to do this using two arrays, one with the alphabet in it, then the other with the substitute values, but I realized I’d have to do a else-if the size of the whole alphabet, which I don’t really have time for. I’d like to know if there is an easier, faster way. This is what I have so far
private string EncryptFn(string Sinput)
{
string STencryptedResult = "Null for now";
char[] CAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
char[] Encrypt = "QWERTYUIOPASDFGHJKLZXCVBNM".ToCharArray();
return STencryptedResult;
}
Thanks
It isn’t a very strong encryption, but you the following version would be extremely efficient and requires very little data to define the encryption: