add encrypt function source code