//For this I made while loop
while (Data.Length > 0)
{
//first I take each character using substring
sValue= Data.Substring(0, 1).ToString()
//then convert character into ascii.
sValue= Strings.Asc(sValue)
//then convert ascii value into Hex Format
sValue = Conversion.Hex(sValue)
//after converting remove the character.
Data = Data.Substring(1, Data.Length - 1);
sHex = sHex + sValue;
}
public string PasswordDecription(ref string Data)
{
string Data1 = "";
string sData = "";
while (Data.Length > 0)
{
Data1 = System.Convert.ToChar(System.Convert.ToUInt32(Data.Substring(0, 2), 16)).ToString();
sData = sData + Data1;
Data = Data.Substring(2, Data.Length - 2);
}
return sData;
}
public string PasswordEncription(ref string Data)
{
string sValue;
string sHex = "";
while (Data.Length > 0)
{
sValue = Conversion.Hex(Strings.Asc(Data.Substring(0, 1).ToString()));
Data = Data.Substring(1, Data.Length - 1);
sHex = sHex + sValue;
}
return sHex;