В классе пишем,
//Convert to Ordinal Value
private int CharToAscii(char a)
{
return (int)a;
}
public string DecryptPaltalkPassWord(string sNickname, string sHwId, string sCrypted)
{
//Some variables we will use
string sTemp = "";
string sFinal = "";
string sCipher = sCrypted;
int iLength = sCrypted.Length;
//Check to make sure it divides into 4
if (iLength % 4 != 0)
{
return "Incorrect encrypted password";
}
//Concatenate Nickname & HwId
for (int i = 0; i <= 7; i++)
{
sTemp = sTemp + sNickname[i % sNickname.Length] + sHwId[i % sHwId.Length];
}
//Create an array
string[] aOutPut = new string[iLength / 4];
//Get longest char of either HwId or Nickname and add it to sTemp(Last longest chars is first to get processed)
if (sHwId.Length >= sNickname.Length)
{
//If the HwID string is longer than password then add last char of to beginning of sTemp
sTemp = sHwId[sHwId.Length - 1] + sTemp;
}
else
{
//If the sNickName string is longer than HwId then add last char of to beginning of sTemp
sTemp = sNickname[sNickname.Length - 1] + sTemp;
}
//Process and calculate Password
for (int i = 0; i <= (aOutPut.Length - 1); i++)
{
//Add the first 3 chars of encrypted string to our array(dropping the 4th as its not needed)
aOutPut = sCipher.Substring(0, 3);
//Calculate char in password
sFinal = sFinal + Convert.ToChar((Int32.Parse(aOutPut) - CharToAscii(sTemp)) - i - 122);
//Remove first 4 chars to get ready for processing next
sCipher = sCipher.Remove(0, 4);
}
//Return our Password
return sFinal;
}
Далее используем:
using System.Runtime.InteropServices;
using Microsoft.Win32;//Registry Access
namespace PaltalkDecrypt
{
public partial class Form1 : Form
{
[DllImport("kernel32.dll")]
private static extern long GetVolumeInformation(string PathName, StringBuilder VolumeNameBuffer,
UInt32 VolumeNameSize, ref UInt32 VolumeSerialNumber, ref UInt32 MaximumComponentLength,
ref UInt32 FileSystemFlags, StringBuilder FileSystemNameBuffer, UInt32 FileSystemNameSize);
public Form1()
{
InitializeComponent();
}
//Get Volume Serial Number {from eggcode web site I just converted to hex}
public string GetVolumeSerial(string strDriveLetter)
{
uint serNum = 0;
uint maxCompLen = 0;
StringBuilder VolLabel = new StringBuilder(256); // Label
UInt32 VolFlags = new UInt32();
StringBuilder FSName = new StringBuilder(256); // File System Name
strDriveLetter += ":\\"; // fix up the passed-in drive letter for the API call
long Ret = GetVolumeInformation(strDriveLetter, VolLabel, (UInt32)VolLabel.Capacity, ref serNum, ref maxCompLen, ref VolFlags, FSName, (UInt32)FSName.Capacity);
//Changed this to return Hex values
return String.Format("{0:X8}", serNum);
}
//Convert to Ordinal Value
private int CharToAscii(char a)
{
return (int)a;
}
public string DecryptPaltalkPassWord(string sNickname, string sHwId, string sCrypted)
{
//Some variables we will use
string sTemp = "";
string sFinal = "";
string sCipher = sCrypted;
int iLength = sCrypted.Length;
//Check to make sure it divides into 4
if (iLength % 4 != 0)
{
return "Incorrect encrypted password";
}
//Concatenate Nickname & HwId
for (int i = 0; i <= 7; i++)
{
sTemp = sTemp + sNickname[i % sNickname.Length] + sHwId[i % sHwId.Length];
}
//Create an array
string[] aOutPut = new string[iLength / 4];
//Get longest char of either HwId or Nickname and add it to sTemp(Last longest chars is first to get processed)
if (sHwId.Length >= sNickname.Length)
{
//If the HwID string is longer than password then add last char of to beginning of sTemp
sTemp = sHwId[sHwId.Length - 1] + sTemp;
}
else
{
//If the sNickName string is longer than HwId then add last char of to beginning of sTemp
sTemp = sNickname[sNickname.Length - 1] + sTemp;
}
//Process and calculate Password
for (int i = 0; i <= (aOutPut.Length - 1); i++)
{
//Add the first 3 chars of encrypted string to our array(dropping the 4th as its not needed)
aOutPut = sCipher.Substring(0, 3);
//Calculate char in password
sFinal = sFinal + Convert.ToChar((Int32.Parse(aOutPut) - CharToAscii(sTemp)) - i - 122);
//Remove first 4 chars to get ready for processing next
sCipher = sCipher.Remove(0, 4);
}
//Return our Password
return sFinal;
}
private void Form1_Load(object sender, EventArgs e)
{
//Create a new registry, default is current user
RegistryKey myRegKey = Registry.CurrentUser;
//Sub key
myRegKey = myRegKey.OpenSubKey("Software\\Paltalk");
// An array to hold our sub keys from CURRENT_USER\Software\Paltalk
String[] subkeyNames = myRegKey.GetSubKeyNames();
//Loop each key and add them to Combobox
foreach (String s in subkeyNames)
{
try
{
//Add to combobox
comboBox1.Items.Add(s);
}
catch (NullReferenceException)
{
}
}
}
private string GetCryptedPass(string sNickname)
{
RegistryKey CryptedString = Registry.CurrentUser;
CryptedString = CryptedString.OpenSubKey("Software\\Paltalk\\" + sNickname);
string sFinal = CryptedString.GetValue("pwd").ToString();
return sFinal;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = DecryptPaltalkPassWord(comboBox1.SelectedItem.ToString(), GetVolumeSerial("C"), GetCryptedPass(comboBox1.SelectedItem.ToString()));
}
}
}
//Convert to Ordinal Value
private int CharToAscii(char a)
{
return (int)a;
}
public string DecryptPaltalkPassWord(string sNickname, string sHwId, string sCrypted)
{
//Some variables we will use
string sTemp = "";
string sFinal = "";
string sCipher = sCrypted;
int iLength = sCrypted.Length;
//Check to make sure it divides into 4
if (iLength % 4 != 0)
{
return "Incorrect encrypted password";
}
//Concatenate Nickname & HwId
for (int i = 0; i <= 7; i++)
{
sTemp = sTemp + sNickname[i % sNickname.Length] + sHwId[i % sHwId.Length];
}
//Create an array
string[] aOutPut = new string[iLength / 4];
//Get longest char of either HwId or Nickname and add it to sTemp(Last longest chars is first to get processed)
if (sHwId.Length >= sNickname.Length)
{
//If the HwID string is longer than password then add last char of to beginning of sTemp
sTemp = sHwId[sHwId.Length - 1] + sTemp;
}
else
{
//If the sNickName string is longer than HwId then add last char of to beginning of sTemp
sTemp = sNickname[sNickname.Length - 1] + sTemp;
}
//Process and calculate Password
for (int i = 0; i <= (aOutPut.Length - 1); i++)
{
//Add the first 3 chars of encrypted string to our array(dropping the 4th as its not needed)
aOutPut = sCipher.Substring(0, 3);
//Calculate char in password
sFinal = sFinal + Convert.ToChar((Int32.Parse(aOutPut) - CharToAscii(sTemp)) - i - 122);
//Remove first 4 chars to get ready for processing next
sCipher = sCipher.Remove(0, 4);
}
//Return our Password
return sFinal;
}
Далее используем:
using System.Runtime.InteropServices;
using Microsoft.Win32;//Registry Access
namespace PaltalkDecrypt
{
public partial class Form1 : Form
{
[DllImport("kernel32.dll")]
private static extern long GetVolumeInformation(string PathName, StringBuilder VolumeNameBuffer,
UInt32 VolumeNameSize, ref UInt32 VolumeSerialNumber, ref UInt32 MaximumComponentLength,
ref UInt32 FileSystemFlags, StringBuilder FileSystemNameBuffer, UInt32 FileSystemNameSize);
public Form1()
{
InitializeComponent();
}
//Get Volume Serial Number {from eggcode web site I just converted to hex}
public string GetVolumeSerial(string strDriveLetter)
{
uint serNum = 0;
uint maxCompLen = 0;
StringBuilder VolLabel = new StringBuilder(256); // Label
UInt32 VolFlags = new UInt32();
StringBuilder FSName = new StringBuilder(256); // File System Name
strDriveLetter += ":\\"; // fix up the passed-in drive letter for the API call
long Ret = GetVolumeInformation(strDriveLetter, VolLabel, (UInt32)VolLabel.Capacity, ref serNum, ref maxCompLen, ref VolFlags, FSName, (UInt32)FSName.Capacity);
//Changed this to return Hex values
return String.Format("{0:X8}", serNum);
}
//Convert to Ordinal Value
private int CharToAscii(char a)
{
return (int)a;
}
public string DecryptPaltalkPassWord(string sNickname, string sHwId, string sCrypted)
{
//Some variables we will use
string sTemp = "";
string sFinal = "";
string sCipher = sCrypted;
int iLength = sCrypted.Length;
//Check to make sure it divides into 4
if (iLength % 4 != 0)
{
return "Incorrect encrypted password";
}
//Concatenate Nickname & HwId
for (int i = 0; i <= 7; i++)
{
sTemp = sTemp + sNickname[i % sNickname.Length] + sHwId[i % sHwId.Length];
}
//Create an array
string[] aOutPut = new string[iLength / 4];
//Get longest char of either HwId or Nickname and add it to sTemp(Last longest chars is first to get processed)
if (sHwId.Length >= sNickname.Length)
{
//If the HwID string is longer than password then add last char of to beginning of sTemp
sTemp = sHwId[sHwId.Length - 1] + sTemp;
}
else
{
//If the sNickName string is longer than HwId then add last char of to beginning of sTemp
sTemp = sNickname[sNickname.Length - 1] + sTemp;
}
//Process and calculate Password
for (int i = 0; i <= (aOutPut.Length - 1); i++)
{
//Add the first 3 chars of encrypted string to our array(dropping the 4th as its not needed)
aOutPut = sCipher.Substring(0, 3);
//Calculate char in password
sFinal = sFinal + Convert.ToChar((Int32.Parse(aOutPut) - CharToAscii(sTemp)) - i - 122);
//Remove first 4 chars to get ready for processing next
sCipher = sCipher.Remove(0, 4);
}
//Return our Password
return sFinal;
}
private void Form1_Load(object sender, EventArgs e)
{
//Create a new registry, default is current user
RegistryKey myRegKey = Registry.CurrentUser;
//Sub key
myRegKey = myRegKey.OpenSubKey("Software\\Paltalk");
// An array to hold our sub keys from CURRENT_USER\Software\Paltalk
String[] subkeyNames = myRegKey.GetSubKeyNames();
//Loop each key and add them to Combobox
foreach (String s in subkeyNames)
{
try
{
//Add to combobox
comboBox1.Items.Add(s);
}
catch (NullReferenceException)
{
}
}
}
private string GetCryptedPass(string sNickname)
{
RegistryKey CryptedString = Registry.CurrentUser;
CryptedString = CryptedString.OpenSubKey("Software\\Paltalk\\" + sNickname);
string sFinal = CryptedString.GetValue("pwd").ToString();
return sFinal;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = DecryptPaltalkPassWord(comboBox1.SelectedItem.ToString(), GetVolumeSerial("C"), GetCryptedPass(comboBox1.SelectedItem.ToString()));
}
}
}