encoding for licensing the software

This forum is for general support of Xbase++
Post Reply
Message
Author
ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

encoding for licensing the software

#1 Post by ampandya »

HI
I have a software which i want to licence to the users.

I have Name, Exp. date and the hardware mac code.

I want to give them the Code to enter which is encoded using these 3 objects.

Could someone please help me for this?

Thank you

User avatar
bborzic
Posts: 21
Joined: Tue Sep 21, 2010 12:39 pm
Contact:

Re: encoding for licensing the software

#2 Post by bborzic »

ampandya wrote:HI
I have a software which i want to licence to the users.
I have Name, Exp. date and the hardware mac code.
I want to give them the Code to enter which is encoded using these 3 objects.
If you have the Xb2.NET library ( see: http://xb2.net/xb2net/ ), then you can use the xbHash function to create a unique hash of the values you specified. Example:

cHash := xbHash( SHA256, cName + dtos(dExpDate) + cHardwareMac )

A hash or message digest is a fixed-size bit string, such that any change to the message will (with very high probability) change the hash value. You can further encrypt the hash value using a secret password, although this step is probably not needed. Example:

cKey := xbRC4SetKey("some secret code")
cEncryptedHash := xbRC4( cKey, cHash )


Since the output from the above functions is a binary string, we can make it more user friendly by converting to base64, eg:

cLicenseKey := xbBase64Encode(cEncryptedHash)

You give the user the above lincense key which they can enter into your program. Your program then verifies it by performing the above calculations internally. If the results match, then the license key is valid.
Regards,
Boris Borzic
http://xb2.net
http://sqlexpress.net
industrial strength Xbase++ development tools

ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

Re: encoding for licensing the software

#3 Post by ampandya »

Many Thanks,

I will try this.

Post Reply