Forward secrecy with RSA is asked here:
- Is perfect-forward secrecy achieved with RSA? and fgrieu gave an answer based on creating temporary RSA keys and signing them. And, in the end, he mentions
The scheme is inefficient because the generation of a new RSA key pair is relatively expensive (and normally rare, thus not optimized for speed)
I will describe a two-pass mechanism; Send a message and receive, done.
As usual, we have Alice with $(pub_A,prv_A)$ public-private keys and Bob with $(pub_B,prv_B)$ public-private keys with modulus $n_A$ and $n_B$, respectively. They know the public-keys.
Let $n = \text{min}\{n_a,n_b\}$
- Alice chooses a random number $x$ and $1<x< n$.
- Alice encrypt this with Bob's public key $c_1 = E(x,pub_B)$ and sends to Bob.
- Bob receives $c_1$ and decrypts $x= D(c_1,prv_B)$ to get $x$
- Bob chooses a random number $y$ and $1<y< n$
- Bob encrypt this with Alice's public key $c_2 = E(y,pub_A)$ and sends to Alice.
- Alice receives $c_2$ and decrypts $y= D(c_2,prv_A)$ to get $y$
- Finally, Alice and Bob use a KDF to derive the ephemeral key, $K_{ep} = KDF(x\mathbin\| y)$ .
It is clear that this doesn't provide integrity. Apart from this
- Is there any security failure? If so, how can we improve it?
- Is there any similar work before?