Manikandan,
I can think of a number of options. First off, if you are dealing with something secure, I would try encryption.
Conversely, you could try hiding in plain sight by attaching the hidden text in an image. Do a google search on "hide text in an image" if you want more information on this.
But if you are hiding something simple like a password link inside an email, you could try hiding it in plain sight in the link. This isn't really encryption, it's obfuscation.
Something like this would take a 20 character string and drop your string in the 34th place. Then, when I call UnObviscateWebUserIdFromQueryString, I go and I grab what I need. It works if all of your strings are of constant length and you are grabbing it the same way every time from the same junk string.
This isn't going to work for a banking application, but if you are using it for something simple like password reset or or passing information that might be confusing to a user and thus they shouldn't be bothered with seeing it, it will work.
Good luck,
Ryan McBeth
public static string GenerateObviscation(int iLength)
{
RandomStringGenerator R = new RandomStringGenerator();
return R.NextString(iLength, true, true, true, false);
}
public static string ObviscateSingleQueryString(string ToObviscate)
{
string sFakeQueryName = GenerateObviscation(40);
sFakeQueryName = sFakeQueryName.Insert(20, "=");
sFakeQueryName = sFakeQueryName.Insert(24 + 1 + 8, ToObviscate);
return sFakeQueryName;
}
public static string UnObviscateWebUserIdFromQueryString(string ToObviscate)
{
string sToReturn = ToObviscate.Substring(sQueryString.Length - 18, 10);
return sToReturn;
}