Add encrypt function along with debug code

Not yet compatible with c# version of obfuscator; needs more debug.