Licensing WPF, Silverlight and WP7 assemblies

2019-07-07 19:03发布

I am looking for a solution to license a WPF, Silverlight and WP7 assembly. The assembly in question is a chart control which has a single API for use across platforms. I am in the process of creating a separate MSI for each platform (WPF, SL, WP7) which users will be able to download and install. This will register the assemblies in their GAC for development use.

What I would like to do is ensure that a single development license is only used by a single developer. It doesn't have to be super secure, just enough to deter would-be hackers. Ideally a solution that covered all three platforms would be beneficial.

I already have a cross-platform obfuscator which I am very pleased with. Shame this doesn't include licensing!

Edit: Additional requirements are that I will be allowing users to download updates for up to one year from purchase date, however the assemblies they purchase will be available for their use indefinitely whether or not they update. Assemblies are to be redistributed so any licensing model must be redistributable on WPF/SL/WP7 platforms.

Your suggestions / comments welcome.

Best regards,

1条回答
对你真心纯属浪费
2楼-- · 2019-07-07 20:02

For your requirements that the licencing methodology 'will "do the job" and prevent low-level licence abuse' I would personally recommend not getting too fancy; that is, to avoid the use of web-activated/maintained licencing. My advice would be similar to the approach outlined here.

  1. Select a symmetric encryption algorithm using the one of the .NET libraries as described in the link above.
  2. Create the required encryption key using a random generator (if you contact me I am happy to share a piece of code I developed to generate a variety of random strings/keys for any required key size), there are also .NET classes to help you do this yourself by generating pseudo-random numbers (RNGCryptoServiceProvider).
  3. Transform/’custom-hash’ the key to provide a new 'hashed encryption key'.
  4. Use this key to generate an Initialisation Vector (IV) and encrypt your licence file.

How you now deploy the application (in terms of licencing) is up to you. The two methods below will work for all three application types above and will offer some degree of consistency for the licencing of each of your products. The above method uses two files for licencing. 'ProductKey.myExtension' and 'LicenceFile.myOtherExtension'. The first contains the randomly generated key, that will be 'hashed'/transformed in the same way as in the licence generator application (you will need a separate (small) application to ‘cut’/create the licence files). The second is the encrypted file with user info, licence period etc.

A. You could now provide an install package for your application that will install your application in the relevant directory (i.e. C:\Pogram Files etc.) without providing the licence files, in which case you can deploy the licence files with a licence installer. The licence could then separately be installed for each user employing `Environment.SpecialFolder's to ensure each user has their own licence (of course this would assume that the 'Administrator' installed the application in the first instance for all users and that the licence install pack would be run on a user-by-user basis). Note: I am currently not familiar with WP7 applications and the specifics in this case.

B. The second way would be to allow individual users to install the application, and to install the relevant licence files upon the applications installation.

I have deployed several WinForm applications using this methodology after an extensive research period and it seems to work well. I hope this is of some help.

查看更多
登录 后发表回答