Method and system for transmitting data between terminal and server and sign-in and payment method

The invention discloses a method and a system for transmitting data between a terminal and a server and a sign-in and payment method. The method comprises the following steps of: encrypting initial data by adopting an RSA (remote signaling alarm) asymmetric encryption algorithm and a 3DES (triple data encryption standard) symmetric encryption algorithm and using a randomly generated session key and the 3DES symmetric encryption algorithm, encrypting the session key by using a public key of an opposite end and the RSA asymmetric encryption algorithm, sending the data of two encrypted parts to the opposite end, decrypting the session key by using a public key through the opposite end, and decrypting the initial data by using the session key. By skillfully combining the 3DES symmetric encryption algorithm and the RSA asymmetric encryption algorithm, the method and the system ensure that the terminal, in particular a POS (point of sale) machine securely transmits the data and performs signature on a public network and ensure high data processing efficiency, the terminal exchanges the data with the server on the public network securely and efficiently, and the terminal, in particular the POS machine securely and efficiently finishes electronic payment on the public network.