The mobile agent paradigm is a promising technology to structure distributed applications. Since mobile agents physically move to a remote host that is under the control of a different principal, they need to be protected from this environment which is responsible for execution. In this paper, we provide a new cryptographic methodology of protecting mobile agents from unauthorized modification for the program code by malicious hosts.