Creating function to encrypt password