Is there a guide on how to implement this without becoming "cracked" or "patched" ?
Nothing you can do will make it impossible for someone to crack your license key system. The more popular your program is, the more likely it is that people will attempt a crack, and someone will succeed.
I'm not sure that you will find a good publicly available guide on how to make cracking difficult, because such a document would also give the crackers lots of clues for their cracking efforts. (Software DRM is a perpetual arms race between the "good guys" and the "bad guys".)
IMO, it is simply not worth trying to get every last drop of revenue for your software. Those cracked keys don't really represent lost sales. The chances are that the people who use them wouldn't buy your software anyway. Just right them off as a revenue source, and focus your efforts on making your software a good experience for the honest people who HAVE bought a license. (The worst thing you can do is to use some DRM scheme that makes life difficult for honest customers!!)