I have a Windows Stand Alone Application software that i need to be password protected.For this i have hashed the unique ids of the system and put into the License text file of the Application folder.
Here is my code to get the License key
public string Value()
{
if (string.IsNullOrEmpty(fingerPrint))
{
fingerPrint = GetHash("CPU >> " + cpuId() + "\nBIOS >> " + biosId() + "\nBASE >> " + baseId()
//+"\nDISK >> "+ diskId() + "\nVIDEO >> " + videoId() +"\nMAC >> "+ macId()
);
}
return fingerPrint;
}
private string GetHash(string s)
{
Label2.Text = s;
MD5 sec = new MD5CryptoServiceProvider();
ASCIIEncoding enc = new ASCIIEncoding();
byte[] bt = enc.GetBytes(s);
return GetHexString(sec.ComputeHash(bt));
}
Now here is my doubt points:
- How to make the software valid for some specified period of time.
- How to Check the License key and Time Duration validation each time software gets started..
- Is my way of approach is correct.
I have tried to implement this in this way because i have heard that windows registry is not the secure way to implement Licensing as any one can easily copy that..
Please help me with your Valuable suggestions. Thanks in advance.