If you want to activate the protection level with a password in the HW Config for an S7 CPU, the below steps shows the three different ways of protecting your S7 program against unauthorized access.
Step 1: Online protection against access to the CPU
The protection level and the input of a password for online access protection is entered in the CPU's object properties in the HW Config.
Step 2: Encrypted block protection (STEP 7 V5.5 onwards)
You must install the "S7 Block Privacy" program from the STEP 7 V5.5 DVD before you can configure encrypted block protection. Then you can configure block protection in the SIMATIC Manager by way of "Tools > Block protection...".
Step 3: KNOW_HOW_PROTECT (STEP 7 V4.0.2 onwards)
A source is generated for the block to be protected. In this source block the keyword "KNOW_HOW_PROTECT" is entered in the declaration part. The block is protected after compiling the source.