Added encrypt function