Various enhancements to encryption method