Added preliminary encryption function