I have a basic protocol which tries to authenticate messages going from client to server. Basically it is like this:
Imagine I want to send message M to server.
Client computes a MAC over the message. The MAC is basically DES_ECB encryption of data MAC_DATA
length of which is 8 bytes. MAC_DATA
is obtained
by XORING the plain message M between each other. Like this
for (int i = 0; i < dwSize; i += DppGlobals.MAC_SIZE)
{
for (int j = 0; j < DppGlobals.MAC_SIZE; j++)
MAC_DATA[j] ^= plaindata[i + j];
}
And MAC is
CALC_MAC = DppDES.EncryptDES_ECB(MAC_DATA, WorkKey);
Finally what client sends to server is:
Client -> Server: CALC_MAC, M
Assume keys are stored securely on client and server, and also they are shared. Now since DES is insecure I am trying to improve this protocol. My idea is basically the client will send to server AES encryption of the data it was sending before. So client sends to server
Client -> Server: C
Where C = AES_ENCRYPT_CBC(CAL_MAC | M, Key, someIV);
The server will decrypt the data it receives, and perform computations like it was doing before.
So is my modified version (with AES encryption) more secure than the old(current) protocol?
Since this protocol is already implemented, the change I want to add for improving its security should desirably be minimal - to avoid introducing new bugs. Also completely rewriting and using TLS is not an option.