The invention provides a method for separating code to an encryption lock from an executable file directly comprising separating code to an encryption lock from an executable file directly, setting a clock timer and a random number generator in the intelligent card encryption lock, filling an interactive code for communication with the encryption lock in the vacancy of the executable file after the code is separated, the encryption lock dynamically decomposing, encrypting and protecting the code that is separated into the lock and needed to be executed continuously by using a specific protocol and algorithm, wherein a plurality of blocks are generated and the release of the block is determined by the normal executed time of the previous block, if the request for demanding the next block sent from the interactive code arrives in the encryption lock in the normal time period, an effective information will be released from the encryption lock, if not, an ineffective information is released. Moreover, a layer of encryption lock filter drive program is added to the encryption lock and the interactive code. Thereby, the illegal monitor and interception of the communication data in the communication link and system are prevented.