|
namespace AddressBook
{
class Converter
{
public static string Encrypt(string StringData)
{
if (StringData == "") return "";
string Encrypted = null;
foreach (char c in StringData)
{
string tmp1 = System.Convert.ToInt32(c).ToString();
foreach (char d in tmp1)
{
Encrypted += ((char)(d + 17)).ToString();
}
Encrypted += "K";
}
return Encrypted.Remove(Encrypted.Length - 1); ;
}
public static string Decrypt(string EncryptedData)
{
EncryptedData = EncryptedData.Trim().Replace(" ", " ").Replace(" ","KDCK");
if (EncryptedData == "") return "";
if (EncryptedData == null) return null;
string[] Chars = EncryptedData.Split((char)75);
string Data = null;
foreach (string word in Chars)
{
string tmp = null;
foreach (char c in word)
{
tmp += (char)(c - 17);
}
Data += (char)System.Convert.ToInt32(tmp);
}
return Data;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Completed B.Com(CS) at DGVC and GNIIT Software Engineering at NIIT. Resident at Chennai and working as a Software Engineer.
Language / Technology :
C#, ADO.NET, ASP.NET, MVC, WCF, ASP, PHP, XML, Java, J2EE, HTML, JavaScript, JQuery, AngularJS, VB Script, C++, MS SQL Server, SSRS, MySql, Oracle, Oracle Forms Development, Windows, Linux.
Click here to view other articles.
Mail Me at: shridhar_tl@ymail.com
Visit my Site: www.iCodeIt.in