"Lua code" Encryption
How would one go about doing such a thing!
Pretty much impossible most people just overuse the term over obfuscation. Obfuscation is just when you hide how the code looks then run it (most people turn a script into a string then loadstring it). This doesn't really do anything since most exploiters use cheat engine (which read memory or something like that, I aint no exploiting master dude). If you want to protect your code try to avoid using localscripts (as exploiters can read them and then modify stuff on workspace and such).
If you are looking to have a password type saving system you would need a Hash function (SHA1,SHA256). For encryption you could use string.byte to encrypt it into it's number form and then use string.char to convert it back to text at a later time.