Could someone please explain in simple terms what is the difference between the generation of keys and the key agreement? In what situation I would use it. en.wikipedia.org/wiki/Key-agreement_protocol key agreement refers to a form of key exchange (see also the encryption key) in which two or more users run a protocol in order to securely release a resulting key value. An important transport protocol can be used as an alternative to the key agreement. The distinguishing feature of a key MOU is that participating users contribute equally to the calculation of the resulting common key value (unlike a user who calculates and distributes a key value to other users). This method reintegrates this keyagrement object so that it can be reused for other key chords. If this key agreement is not re-initiated by one of the init methods, the same private information and algorithm settings are used for the following key agreements. In cryptography, a key memorandum of understanding is a protocol in which two or more parties can agree on a key so that both influence the outcome. If this is done correctly, it prevents undesirable third parties from imposing an important decision on the appropriate parties. Protocols that are useful in practice also do not reveal to a listening party the key that has been agreed upon. Many key exchange systems have a part that generates the key and simply sends that key to the other party — the other party has no influence on the key. The use of a key MEMORANDUM of understanding avoids some of the major distribution problems associated with these systems.
The most important agreement is that the key source must be such that at the end of the process, two specific entities know the key and only these. A perfect example is the Diffie-Hellman protocol, in which both parties use randomness to create data elements, exchange some of these elements, and make some calculations that end up getting the same result, while external observers are not impressed. The keys involved in setting up a common secret key are created by one of the key generators (KeyPairGenerator or KeyGenerator), a KeyFactory or following an intermediate phase of the key memorandum of understanding. Commonly used key agreement protocols include diffie-hellman or protocols based on the RSA or ECC.