Actually it depends with what you need to encrypt, Themida (which has a special kernel-mode driver that facilitates some of the protection features) is as fine as CodeVirtualizer, but if you are talking about a .Net assembly there are better solutions.
If you are asking yourself how Themida works then see the original webpage. It makes a virtual machine within particular parts of the code which runs some threads to prevent breakpoints or other manipulations set by a cracker, that's also useful to catch debuggers out.
What do you need to encrypt (what type of file? example; .swf), it's fairly easy to make your own encrypter, which is actually best in most situations.