I would like to use IES (x25519 and AES-GCM), but every message used a new session key, does that affect the performance of the system? do I need to used session key to refer to the key that used by previous session?
For example,
- Assume Alice knows Bob's public key.
- Alice would like to send a message to Bob.
- Alice generates her public and private keys,
Then, she derives a session key k by using her private and Bob's public keys.
Then, by using AES-GCM provides authentication for her public key and encrypts the message.
- She sends her public key and encrypted message to Bob.
- Bob drives the key and decrypts the encrypted message.
- Bob replay by encrypted the message by using the k.
- Then, if Alice would communicate with Bob, she repeats generates her public and private key.