Method and system for authentication and electronic signature