Coding unlock codes

 
Can someone direct me to some examples of how to write code that utilizes 'unlock codes' for protection.
 

SR, Would assume that this is a computing query. iow, language/platform is not issue. Design is issue. Find design and hack in whatever syntax takes yer fancy.