View previous topic :: View next topic |
Author |
Message |
tslewis
Joined: 06 Mar 2013 Posts: 38
|
Posted: Fri May 15, 2015 9:20 pm Post subject: ADVICE for Enrypted Licensing |
|
|
I am avoiding authenticated licensing for now until I have a web page set up to allow a user to do this and authenticate automatically.
I am using the standard encrypted licensing model - simple Encrypted Licensing.
Is there a way to provide more security by asking the user to provide a machine ID and include that as a parametrr in the license. The user would run a script to obtain their machine id, send it to me, I would add it to the parameter, and when licesing checks are initiated I would compare the machine ID with the parameter.
Seems like a user can just share the key and there is no security.
Also, I want to uninstall the license when my installer uninstalled my program. I am using WIX and have already written some custom actions. Can you provide a sample for Simple Encrypted Licensing? I see an example here for authenticated
http://www.infralution.com/phpBB2/viewtopic.php?t=2573 |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri May 15, 2015 11:22 pm Post subject: |
|
|
You can included a machine ID in the ProductInfo of the license key when you generate it then check this when the license is loaded. You would want to keep the ID short because the more information you include in the ProductInfo the longer the generated keys become. The LicenseUtilities class/module contains a Checksum function that produces a short ID from a longer string which can be suitable for this.
The WIX uninstall code for EncryptedLicense is the same as for AuthenticatedLicenses - except you can just call provider.UninstallLicense without deauthenticating ie:
Code: |
[CustomAction]
public static ActionResult UninstallLicense(Session session)
{
try
{
EncryptedLicenseProvider provider = new EncryptedLicenseProvider(LICENSE_PARAMETERS, _licenseFile);
provider.UninstallLicense();
}
catch (Exception e)
{
ShowError(session, string.Format(LicenseResources.UninstallErrorMsg, e.Message, _licenseFile));
}
return ActionResult.Success;
} |
_________________ Infralution Support |
|
Back to top |
|
|
tslewis
Joined: 06 Mar 2013 Posts: 38
|
Posted: Sun May 17, 2015 11:14 pm Post subject: |
|
|
Infralution wrote: | You can included a machine ID in the ProductInfo of the license key when you generate it then check this when the license is loaded. You would want to keep the ID short because the more information you include in the ProductInfo the longer the generated keys become. The LicenseUtilities class/module contains a Checksum function that produces a short ID from a longer string which can be suitable for this.
The WIX uninstall code for EncryptedLicense is the same as for AuthenticatedLicenses - except you can just call provider.UninstallLicense without deauthenticating ie:
Code: |
[CustomAction]
public static ActionResult UninstallLicense(Session session)
{
try
{
EncryptedLicenseProvider provider = new EncryptedLicenseProvider(LICENSE_PARAMETERS, _licenseFile);
provider.UninstallLicense();
}
catch (Exception e)
{
ShowError(session, string.Format(LicenseResources.UninstallErrorMsg, e.Message, _licenseFile));
}
return ActionResult.Success;
} |
|
why would one care about the length of the key? The user only needs to install the key once so what does it matter? Its just copy and paste right? Does the length of the key affect the performance of my application? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun May 17, 2015 11:17 pm Post subject: |
|
|
Some people care about the length of the key. If you want to be able provide someone a key over the phone for instance it is important. The database does have a limit on the length of the key it can store (255 characters) so there is eventually a limit - even though you are not likely to hit it. _________________ Infralution Support |
|
Back to top |
|
|
|