Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27489

Reversing this code?

$
0
0
looking at some legacy code, this is trying to "encrypt" an input string. Not the best way:

Code:

rawData=lcase(rawData)
encrypted=""
for iIdx=1 to len(rawData)
        encrypted=encrypted & chr(asc(mid(rawData,iIdx,1))+13)
next

C#:

Code:

rawData= Convert.ToString(rawData).ToLower();
encrypted= "";
for (var iIdx = 1; iIdx <= rawData.Length; iIdx++)
{
        encrypted= encrypted + (char)(Convert.ToInt32(rawData[iIdx - 1]) + 13);
}


I am wondering if there is a way to reverse the generated string in encrypted so I can get back the original input?

Viewing all articles
Browse latest Browse all 27489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>