added readfile function for password encryption