Steps for securing a commercial software?

I am trying to understand how I can protect my program.When the user gives the correct serial key,the program should unlock itself.And it should create different serials for different users.

I came across crytography,encryption methods but I am a bit confused,I am not sure how I can use crytography for securing my program.

If you can give some information about it or give link to a webpage which explains steps in a basic,easy language I will be happy.I searched on google, but haven't found information which I exactly want yet.

I can't speak for certain, but I think the serial key days are over, seeing as they're so easy to crack. I think a lot of stuff is moving to login/distribution systems like steam and minecraft.

You should always consider first: how many people will always steal your product no matter what? People who like your product will want to pay you for it, but people who don't want to pay will generally always find a way around any security you put in place. Decide whether it's worth it ;)

I am trying to understand how I can protect my program.When the user gives the correct serial key,the program should unlock itself.And it should create different serials for different users.

You're stuck in the 90s. What's the first thing people will do if they want to unlock your program? Buy it? No, they'll search the internet for a valid code.

In my opinion, the better way to do things is: offer a basic freeware version, and an improved payware version, that people must pay for to download. So two different versions, and forget about serial keys.

And generally, enterprise level software will come with some form of support (which is a big thing people pay for). If they steal the software, they won't have an account or whatever, and therefore will not be getting support.

Alright, I don't understand all the negative opinions towards serial numbers... Most software still use them, even on Steam and with other distributors like GamersGate, Microsoft, etc... True you buy a game with an account for which you log in to download it, however they all still use a serial number as well. Sort of a second line of defense.

Generally you will have a keygen that will pump out serial keys for your product, you then need to encrypt them keys and generally you would store them on a server. That way when a customer purchases a copy of your product they would receive a valid key which when they enter it it is cross referenced with the keys on the server.

Though this is a becoming a very outdated practice because like others are saying it is easy to crack the serials. So you might want to consider other methods like logins and other suggestions made.