Suppose I want a server to provide some simple, primarily file related functionality and I want to allow access to all users that have a certain public key (server has the private key) and password to the server. It would be a server that few people would know the purpose for (IP would be explicitly shared only with a handful of people), and all its ports besides the one for this functionality would be non-listening. None of the data is important, the main goal is to just avoid any potential issue with someone attacking the server for the heck of it.
What would be the issues/weaknesses with the following approach? I'm not really interested whether it's inefficient, just what the security risks are if I can assume an attacker does not have access to the public key, private key, or the password.
- Client encrypts password with public key and sends it over to the server. Server decrypts it, validates the password, or TCP session ends. The password is distributed to users, and not possible for users to assign, so hashing it does not seem crucial.
- Client generates a symmetric key (AES), encrypts it with public key and sends it over to server.
- Server creates a nonce, encrypts it with symmetric key, and sends it to client. Client decrypts it, concatenates it with a string T (hardcoded constant known to clients and server), encrypts it, and sends to server. Server validates that it received nonce + T, else session ends.
- Data transfer starts, using the established symmetric key.
I can see there's no authentication of the server - but I can't really any issue with that.