# How to use GCM mode and associated-data properly

I'm currently migrating a project to use the bouncy castle GCM mode. I understand that using an authenticated mode removes the need for a HMAC, however I want to be sure that I'm using this mode correctly. When applying a HMAC to ciphertext, I know it's imperative to include in the HMAC'd data any params that could affect the outcome of the decryption (IV, block-size, algorithm name, etc). The bouncy castle GCM implementation accepts AEAD parameters, one of which is 'Associated Text'.

With authenticated modes, is it correct to:

• use encryption params as Associated Text
• encrypt cleartext (without params appended)
• append params to ciphertext (in cleartext) to facilitate future decryption

I assume this workflow applies to EAX mode as well?

-

Sorry to be a pain in the a but I was under the impression that salts (whether for hashes or KDFs) didn't need to be secret. Is there an advantage to keeping them secret? –  hunter Mar 18 '13 at 17:02