-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any public key/license will work? Doesn't enforce licensing? #44
Comments
Normally it's the inverse... |
@caverna I get what you're saying, I know programs can be cracked but the instructions for Portable.Licensing suggest that you might as was well not have a license following their instructions. All you need to do is make a new one using their library, you don't even need to crack the program. This is from the Git Portable.Licensing instructions:
|
@sparra1000 think this way: your program has a private key inside it (deep burry, I hope), but when you create a license information, you'll encode using the public key of this pair... |
@caverna I understand what you're saying but my issue is with Portable.Licensing and how they instruct to use their library. Portable.Licensing doesn't mention ever putting the private key in the program. They only say to distribute the public key and license file with the application to license. This is the code they use for an example, there is no private key:
|
Exactly, the private key is for creating/signing new licenses. The public key is for validating licenses/signatures. So never ever distribute your private key to the public or within your application. |
@dnauck I'm doing exactly as your instructions say and it works but my original issue/question is still unanswered. My issue is, I don't see how this licensing strategy prevents anyone from using your library to generate a new public key and license to be used for my product. If a public key file and license file are read in from an application, anyone can put a new combination pair in its place. Is that correct? This will hopefully explain my question:
How do you enforce that the license.lic/license.pub files I create are the only one that can be used with the distributed product? It seems that you can't. Am I missing something? |
I am just thinking what is stopping to download sources recompile and drop dlls without assertion? |
@sparra1000 i think you need to compile your public key in your web application. If you provide your public key as file as you did, then you are right it can be replaced as you described. @vovikdrg i guess, you would need to sign you complete application and all DLLs you use in it to prevent this. |
What's stopping anyone from making there own public key file/license file to replace the public key distributed with your applications? What am I not seeing?
All someone needs to do it create a new key/license with your library
var keyGenerator = Portable.Licensing.Security.Cryptography.KeyGenerator.Create();
var keyPair = keyGenerator.GenerateKeyPair();
var privateKey = keyPair.ToEncryptedPrivateKeyString(passPhrase);
var publicKey = keyPair.ToPublicKeyString();
Make a new license like the one distributed with application
var license = License.New()
.WithUniqueIdentifier(Guid.NewGuid())
.As(LicenseType.Trial)
.ExpiresAt(DateTime.Now.AddDays(30))
.WithMaximumUtilization(5)
.WithProductFeatures(new Dictionary<string, string>
{
{"Sales Module", "yes"},
{"Purchase Module", "yes"},
{"Maximum Transactions", "10000"}
})
.LicensedTo("John Doe", "john.doe@yourmail.here")
.CreateAndSignWithPrivateKey(privateKey, passPhrase);
Copy that pub key into the application to replace the distributed public key and they can use a new license whenever they want. All they need to do is open the license file to see the format to recreate. I don't see how this enforced licensing.
The only way I see to make it more secure is to include the public key as a string in the application so it can't be replaced easily.
Do I understand this correctly?
The text was updated successfully, but these errors were encountered: