In this paper we survey the current literature on code obfuscation and review current practices as well as applications. We analyse the different obfuscation techniques in relation to protection of intellectual property and the hiding of malicious code. Surprisingly, the same techniques used to thwart reverse engineers are used to hide malicious code from virus scanners. Additionally, obfuscation can be used to protect against malicious code injection and attacks. Though obfuscation transformations can protect code, they have limitations in the form of larger code footprints and reduced performance.