Copy protection

J

John Dann

Seems like the copy protection (ie licensing/antipiracy) tool that I
used with VB6 isn't very compatible with VB.Net. Anyone have a
recommendation for one that works well with VB.Net applications? Only
basic protection is really needed, so simple to use and cheap are more
important than absolute protection.

JGD
 
K

Ken Tucker [MVP]

Hi,

Licensing.
http://windowsforms.net/articles/Licensing.aspx

Ken
-------------------------
Seems like the copy protection (ie licensing/antipiracy) tool that I
used with VB6 isn't very compatible with VB.Net. Anyone have a
recommendation for one that works well with VB.Net applications? Only
basic protection is really needed, so simple to use and cheap are more
important than absolute protection.

JGD
 
P

Paul Bromley

Hi John,

I had a similar problem and solved this by using MD5 encryption - do a few
searches on Google and you will find suitable examples. I generate a unique
Key string based on a number f parameters that I ask them to send me. This
does a comparison with the string that their entries will generate, and if
there is a match then the registered version loads. The application that I
distribute works with a server - hence the application is locked to that
server. Below is the function that I used:-

Imports System.Text
Imports System.Security.Cryptography
Module modEncrypt
Public Function HashData(ByVal s As String) As String
'Convert the string to a byte array
Dim bytDataToHash As Byte() = _
(New UnicodeEncoding()).GetBytes(s)
'Compute the MD5 hash algorithm
Dim bytHashValue As Byte() = _
New MD5CryptoServiceProvider().ComputeHash(bytDataToHash)
Return BitConverter.ToString(bytHashValue)
End Function
End Module


I call the function with somethin g like:-

txtKeyCode.Text = HashData(sServer & sVersion & sApplication)

txtKeyCode.Text is the Key that I send to them that makes a comparison to
the key genrerated in their application.



Hope this is self explanatory and that it helps you. It seems to work very
well for me.



Paul
 
J

John Dann

Thanks Ken and Paul for the replies. The .Net LicenseClass looks
interesting, but I'm struggling a little to follow what I guess are
the C# examples. Presumably there's not a simple VB.Net example
anywhere (I couldn't see one in the download)?

And the roll your own approach is interesting too and probably
adequate for my needs in this instance, but for a WinForm application
that's not locked to an individual PC specification I guess you're
going to need to write something to the registry to persist any key or
licence-dependent information between sessions (since storing in a
simple file would presumably make it too easy to copy). And registry
writing is something I've tended to steer clear of, but maybe I need
to learn more about this.

John Dann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top