How to implement copyright protection through protection key

Hi,
How can i protect an app from being copied and shared, i want to implement protection similar to how microsoft office or windows is activated but without an activation server

Regards