I have it working, but I had a question. Is it OK for the key and the
message to be the same? From a cryptographic perspective? Is this
approach just as secure as having a key that is different from the
message?
Thanks and here's my code:
// SHA1
CryptoPP::SHA1 hash;
// HMAC
CryptoPP::HMAC<CryptoPP::SHA1> mac;
char hmac[ hash.DigestSize() ];
mac.SetKey( (const byte*)sentence.c_str(), sentence.size() );
mac.Update( (const byte*)sentence.c_str(), sentence.size() );
mac.Final( (byte*)hmac );
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.