I'm currently developing a project for highly sensitive data which needs to be transfered over a very questionable network. While I'm not really happy about that at all, it's probably unavoidable anyway. The good news however is that the participating users are very limited, which would make it possible to use the Username/Password to actually encrypt the first packages that are sent. So here is what I'm thinking:
- The Client sends Username/Password-Hash encrypted with a key generated by a combination of the two using a bijective function.
The Server trys to encrypt this using every single Username/Password-Hash combination found within the database, if successful
2.1 a private Key is generated which is valid for the session only and will only be used once.
2.2 The private Key is send to the client using the same Username/Password-Hash generated Key.
if not successful
2.3 NO LOGIN is send to the client using no encryption.
Well my question here is:
Will this method compromise the encryption in any way? Or am I completely missguided?
Using a public key is not really an option, since the key could be attained by reverse-engeneering/listening in on the first package where the public key is exchanged/...