How to work with asymmetric encryption?
For example RSA: everywhere write a pier generated private key and a public. Open, closed-encrypt the decrypted. But what about the answer? For example closed on the server, and I need to encrypt the response. How to be here? Generate client-side closed and the server to send the public the opportunity to encrypt the response? To encrypt the response and decode closed-open (although the idea of an outdoor shared publicly)? Or switch to another encryption algorithm, such as symmetric ciphers?
Asymmetric encryption and decryption are slow. Therefore, this method is passed only just generated session password, and asymmetric encryption allows you to think that no one caught. A further session is encrypted with a symmetric fast algorithm.