|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Encrypt a date to use in demo versionMy app creates a rigistry entry of the date when it is installed, which
is then used to determine when the demo expires...It is working fine but I would like to encrypt the date somehow...is there a relative easy way to do this, as different machines will have different date formats?? I am using Visual Studio 2005(VB.Net) "Christie" <c.mybu***@yahoo.com> wrote in message Check out the System.Security.Cryptography namespace.news:1159280772.462056.294700@m73g2000cwd.googlegroups.com... > My app creates a rigistry entry of the date when it is installed, which > is then used to determine when the demo expires...It is working fine > but I would like to encrypt the date somehow...is there a relative easy > way to do this, as different machines will have different date > formats?? > > I am using Visual Studio 2005(VB.Net) Christie wrote:
> My app creates a rigistry entry of the date when it is installed, which Hi Christie,> is then used to determine when the demo expires...It is working fine > but I would like to encrypt the date somehow...is there a relative easy > way to do this, as different machines will have different date > formats?? > > I am using Visual Studio 2005(VB.Net) Dim s1 As String = Now().ToBinary.ToString ' convert date to string Dim d1 As Date = Date.FromBinary(Val(s1)) ' convert string back to date The string contains a Long numeric representation of the date/time, which always works regardless of your regional settings. Then it's just a matter of encrypting/decrypting the string. You could use the Cryptography namespace as suggested; it's a bit daunting to learn, but worth it. There's also any number of all-VB encryption techniques you could Google up, or you could even whip up your own. Just depends on how strong you prefer your encryption. Christie wrote:
> My app creates a rigistry entry of the date when it is installed, which Hi Christie,> is then used to determine when the demo expires...It is working fine > but I would like to encrypt the date somehow...is there a relative easy > way to do this, as different machines will have different date > formats?? > > I am using Visual Studio 2005(VB.Net) Dim s1 As String = Now().ToBinary.ToString ' convert current date to string Dim d1 As Date = Date.FromBinary(Val(s1)) ' convert string back to date The string contains a numeric Long representation of the date/time, which works regardless of the regional settings. Then it's just a matter of encrypting/decrypting the string. You could use the Cryptography namespace as suggested; it's a bit daunting to learn but worth it. Or, you could Google up source code for any number of all-VB encryption functions. Or, whip up your own. Just depends on how strong you want your encryption. Do a quick search in this news group for "Database Connectivity"
Towards the end "Izzy" posts the source code for a 128 bit encryption scheme. I haven't tried it but you should definately check it out. Thanks, Seth Rowe tesla***@hotmail.com wrote: Show quoteHide quote > Christie wrote: > > My app creates a rigistry entry of the date when it is installed, which > > is then used to determine when the demo expires...It is working fine > > but I would like to encrypt the date somehow...is there a relative easy > > way to do this, as different machines will have different date > > formats?? > > > > I am using Visual Studio 2005(VB.Net) > > Hi Christie, > > Dim s1 As String = Now().ToBinary.ToString ' convert current date > to string > Dim d1 As Date = Date.FromBinary(Val(s1)) ' convert string back to > date > > The string contains a numeric Long representation of the date/time, > which works regardless of the regional settings. > > Then it's just a matter of encrypting/decrypting the string. You could > use the Cryptography namespace as suggested; it's a bit daunting to > learn but worth it. Or, you could Google up source code for any number > of all-VB encryption functions. Or, whip up your own. Just depends on > how strong you want your encryption. |
|||||||||||||||||||||||