Hello itsang;
To lock your blocks, generate a source of the completed and tested function, add the entry KNOW-HOW PROTECT after the block name, compile it and save it in a library. You can now call but you cannot (not even you, the author) open it with regular Step7 tools anymore [Note; keep a copy of the original function in a safe place, you might need it to understand what you did exactly, 6 months from now].
Search Step7 help files for KNOW-HOW PROTECT for more information.
Now, to unlock the files (yours or someone else's) you must use external software. Luca Galina at Runmode.com sells the S7Canopener, that does exactly waht you want. Also, I remember a thread recently hon this forum that discussed doing the same thing using Office software... Search this forum for more details.
Hope this helps,
Daniel Chartier