License key generation

Hello!
I would like to know how to make license keys for my program? How to prevent the transfer of key to other users.
Do you use licenses for your programs?
Registered users can post here. Sign in or register to post.