I want to protect me application and would like to do something similar to this:-

Encrypt original .class file. Add some valid code to this file. Now on loading the added code checks for some authorization. If we have the permission to execute, then it (the added code)decrypts the rest of the file and runs it. If we decopile this program we should get the encrypted file or the decompiler should crash.

A corollary to this question is can we provide a hook in the JVM that would execute our code before the JVM verifies the byte code?