Protection of software code against illegitimate modifications by its users is a pressing issue to many software developers. Many software-based mechanisms for protecting program code are too weak (e.g., they have single points of failure) or too expensive to apply (e.g., they incur heavy runtime performance penalty to the protected programs). In this thesis, We present and explore a methodology that we believe can protect program integrity in a more tamper-resilient and flexible manner. we describe a dynamic integrity verification mechanism designed to prevent modification of software. The mechanism makes use of multi-blocking encryption technique so that no hash value comparison is needed and if the program was altered, the program will not exit in a traceable way. We also make use of common virus techniques to enhance our security. Our mechanism operates on binaries that can be applied to all PE format files like EXE and DLL. The overhead in runtime execution and program size is reasonable as illustrated by real implementation.