To setup a secure channel with server I use the following setup in my application:
1.Generate a random AES key and random IV
2.Encrypt AES Key, IV and client credentials with RSA public key
3.Send to Server
4.Server decrypts using private RSA key
5.Server verifies credentials
6.Server replies with [(OK or FAIL) + random salt] encrypted with AES key
7.Client verifies response
8.Communication channel is designated as authentic and session as valid
9.All further business communication go via same AES key until session end (Disconnection)
Additional details:
1.Public and private RSA keys are hard-coded and constant for application's lifetime i.e. no procurement of public key from external source happens
2.All constant known plain-texts like OK FAIL etc are sent with salt
I beleive this setup should pretty much be fool proof unless someone has access to client or server operations (or breaks RSA)
Are there any potential loop-holes in this setup that I failed to realise or overlooked?