I\'m trying to do key exchange using the following scheme. 1. Server generates a
ID: 659353 • Letter: I
Question
I'm trying to do key exchange using the following scheme.
1. Server generates an RSA-2048 key pair and sends the public part to the client
2. Client generates an RSA-592 key pair (I have to use RSA-592 due to client performance reasons; 592 bits is the minimum key size for encrypting 256 bits using OAEP)
3. Client encrypts the public part of the key pair using the public key from the server, and sends it to the server
4. Server encrypts AES-256 key (random) using the client's RSA key pair, and sends it to the client
So, is this secure than plain RSA-592?
Explanation / Answer
Your scheme is not secure as you're sending the private key of the server over the wire (in your first step).
Extension (after update of question)
The scheme is still not secure as now I can intercept the public key from the server and replace it with my own certificate (Man-in-the-Middle-Attack).
To secure your scheme you have to use a CA (even you can create your own CA for this).