Hey Guys,
I have a Splash Screen that generates a 16 Digit String mixed with Letters and Digits (like: IUH64KJF743FGKG) etc...
I'm using Streamwriter to generate a file and write this unike key into it and read from it as well. The same string is also inserted into a remote mySQL DB and later compared.
However, i dont want the User of my Program find this file as he could manipulate or even DELETE it (which would make him able to override a 30 day trial)
I'm not going into specifics but is there another way to write this key and read it other than place it into a file? Yes, i know, writing into the registry but i already have this as well...
My initial idea was to create a file.dll which is in fact a text file but to camouflage it as .DLL and place it inside the System32 Folder. (because a hacker knows a DLL is compiled and not readable) but the file is only 1kb in size.... that again would be suspicious.
How would you "hide" this 16bit key other then tarnish it as DLL inside the system folder (no access, so forget it) i need to create the file, read and write to and from it.
Any Ideas?
Thank you
Randy
For those who are interested:
I have a Splash Screen that generates a 16 Digit String mixed with Letters and Digits (like: IUH64KJF743FGKG) etc...
I'm using Streamwriter to generate a file and write this unike key into it and read from it as well. The same string is also inserted into a remote mySQL DB and later compared.
However, i dont want the User of my Program find this file as he could manipulate or even DELETE it (which would make him able to override a 30 day trial)
I'm not going into specifics but is there another way to write this key and read it other than place it into a file? Yes, i know, writing into the registry but i already have this as well...
My initial idea was to create a file.dll which is in fact a text file but to camouflage it as .DLL and place it inside the System32 Folder. (because a hacker knows a DLL is compiled and not readable) but the file is only 1kb in size.... that again would be suspicious.
How would you "hide" this 16bit key other then tarnish it as DLL inside the system folder (no access, so forget it) i need to create the file, read and write to and from it.
Any Ideas?
Thank you
Randy
For those who are interested:
Generate Random Key and Write into File:
const string src = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
int length = 16;
var sb = new StringBuilder();
Random RNG = new Random();
for (var i = 0; i < length; i++)
{
var c = src[RNG.Next(0, src.Length)];
sb.Append(c);
}
// create a file and write the software key into it. we need this later to call the correct data from a external db
if (File.Exists("fsds.dll"))
{
string[] a_content = File.ReadAllLines(@"fsds.dll");
if (a_content[0] == null)
{
// do nothing
}
else
{
// do nothing
}
}
else
{
....bla bla
}
using (StreamWriter writetext = new StreamWriter("fsds.dll"))
{
writetext.WriteLine(sb.ToString());
}