I have a client-side web application running on SharePoint Site Collection, each site collection has it's own unique id. I want to use a licensing process to lock the app to a site collection.
This is the challenge-response process I'm trying to implement:
- User prompted to generate
challenge code
challenge code
issite_collection_id
processed through some function- User emails me
challenge code
- I encrypt/hash
challenge code
with someting (RSA private key?) - The encrypted result is considered the
license key
which I send to user - User saves
license key
into the application
Validation Process:
- On app load, retrieve
license key
- Decrypt/un-hash
license key
using something (RSA public key?) - The result is the
challenge code
the user had sent before - Compare the
challenge code
you've generated from thelicense
to the one you'd get from the site to determine if they match
Does this make sense? The one thing I'm not sure about is the public/private key stuff and if there's a way to do this in JavaScript. From what I've read, I can't use RSA securely to encrypt with private key and decrypt with public. It's normally the opposite. So I'm looking for alternatives
Just to be clear, I need to store something in the application script that I can use to decrpyt the license but I'd be encrypting the challenge code either on a different site or server side
I know it's impossible to 100% secure client-side applications. I'm just looking for something to prevent someone from easily distributing the application