Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is HMAC secure if message is not encrypted?

24 views
Skip to first unread message

Tim Boemker

unread,
Feb 16, 2012, 11:12:16 AM2/16/12
to
The Java Secure Socket Extension Reference Guide (http://
docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/
JSSERefGuide.html) says this about HMAC:

"If Alice wants to be sure that Charlie does not tamper with her
message to Bob, she can calculate an HMAC for her message and append
the HMAC to her original message. She can then encrypt the message
plus the HMAC using a secret key she shares with Bob. When Bob
decrypts the message and calculates the HMAC, he will be able to tell
if the message was modified in transit. With SSL, an HMAC is used with
the transmission of secure data."

Suppose that Alice doesn't care whether Charlie can read her message
to Bob; she cares only that Charlie can't tamper with it. In that
case, is is necessary for Alice to encrypt the message (plus the
HMAC), or could she send the plaintext of the message plus the HMAC?

If it's necessary for Alice to encrypt the message plus HMAC, is it
necessary that the encryption key be different than the one used to
compute the HMAC?

Scott Fluhrer

unread,
Feb 16, 2012, 12:20:12 PM2/16/12
to

"Tim Boemker" <t...@boemker.com> wrote in message
news:b034b3dd-42a6-4ab8...@m5g2000yqk.googlegroups.com...
> The Java Secure Socket Extension Reference Guide (http://
> docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/
> JSSERefGuide.html) says this about HMAC:
>
> "If Alice wants to be sure that Charlie does not tamper with her
> message to Bob, she can calculate an HMAC for her message and append
> the HMAC to her original message. She can then encrypt the message
> plus the HMAC using a secret key she shares with Bob. When Bob
> decrypts the message and calculates the HMAC, he will be able to tell
> if the message was modified in transit. With SSL, an HMAC is used with
> the transmission of secure data."
>
> Suppose that Alice doesn't care whether Charlie can read her message
> to Bob; she cares only that Charlie can't tamper with it. In that
> case, is is necessary for Alice to encrypt the message (plus the
> HMAC), or could she send the plaintext of the message plus the HMAC?

If all you need is just message integrity, just doing HMAC is a perfectly
fine idea. In fact, if you use an SSL cipher suite that does only integity
(say, 2 == TLS_RSA_WITH_NULL_SHA), that is precisely what it does.

--
poncho



0 new messages