I am implementing a custom challenge-response protocol to authenticate a client to a server. Mutual authentication is not required, i.e. the server doesn't need to be authenticated to the client.
The protocol works over TCP. Client and server are in a LAN (not over the internet). There is only one server and only one client. The authentication is designed as follows:
$S \rightarrow C : N$
$C \rightarrow S : \{N\}_K$
Where the server $S$ creates a 128-bit random number and sends it as nonce $N$ to the client $C$. The client encrypts the nonce with AES-192 with the pre-shared key $K$ and sends it as response to the server. Then the server decrypts the message and checks the nonce.
Questions:
- Is this protocol design secure?
- What would be the advantage to use HMAC (or any other MAC) instead of AES encryption?
- Did I miss something?