I am working on a project that uses PAKE (SRP) for authentication. When we send the M1 to the server we are encrypting the payload using AES-GCM. I mention SRP only to set the context:
- A message is being sent to the server with content we want to protect
- The client and server have a unique (one-time) symmetric key shared between them (thanks to SRP)
Before I encrypt the payload I generate a unique IV
(nonce
). After running the message through the cipher I have the encrypted message and a tag
(message authentication code).
Therefore, the REST payload to the server roughly looks like:
{
"kid": "LJNZZFQYWGTLBN4OROQ4J7GLBD",
"enc": "AES-GCM",
"iv": "AkR5QsOAwokwwopEBDDDjQ==", // base64
"tag": "8ja1fhFeoUbgOmNzYV9zEQ==", // base64
"data": "MIyMy3p3GIUZG6rJV3cZA7qXEcREIKumfAtT"
}
I am struggling to understand the benefit of sending the tag
. Since we are using SRP the client and server are already using a unique (one-time) session key K.
Can't I just rely on the session key K to determine authenticity? That is, if the message is authentic, then I would be able to decrypt it using K and parse the JSON result into a valid value. (Note: In SRP the shared session key K is a symmetric key which can be used for encryption)
Further, would I send the tag
in plaintext as listed above? Maybe asked differently, do I need to have any special handling of the tag
when transmitting it to the server? (Is base64 a reasonable format?)
I am very green when it comes to cryptography (and trying to pick it up quickly). Any support appreciated.