I was having a conversation with some programmer friends about securing an API without server modification.
Only SFTP access to the filesystem is allowed and OpenSSL extension is installed, the admin won't allow you to install SSL certificates and therefore in this thought experiment, you're only allowed to upload normal code files to the server.
I'd be very happy if somebody here can tear holes in the solution.
Please ignore identity problems, this solution ignores MITM attacks from knowing WHO the client and server are proved to be who they are supposed to be. So all manner of DNS or network level attacks are not part of the discussion.
So, the communication goes like this
- Client generates it's own public key, so secure replies
- Client knows the endpoint in the server to request it's public key
- Client connects to endpoint, obtains public key of server
- Client wants to login to server, builds message and inserts it's public key for any replies to be encrypted with
- Server receives message, decrypts using it's private key, extracts public key and interprets and builds reply message
- Server encrypts final message using client public key and sends the data back
- Client decrypts the data using it's public key and the cycle begins again
First question arise in that does this system already exist and has a name?
Of course SSL certificates can solve this problem, but in this thought experiment, you cannot install them, so they won't help to solve this problem.
Is the above method secure? and if not, what holes can you think of?