javascript - Encryption: What is a tag? -


i reading through node-forge documentation , keep seeing reference 'tag' variable. tag , meant for?

in examples given, they're using aes in galois/counter mode (gcm). gcm provides both confidentiality (similar ctr mode), , message integrity (similar if using hmac in addition aes).

the tag authentication tag. it's computed each block of ciphertext, , used verify no 1 has tampered data.

you can see these lines here:

var pass = decipher.finish(); // pass false if there failure (eg: authentication tag didn't match)  if (pass) {   // outputs decrypted hex    console.log(decipher.output.tohex()); } 

where check made see if authentication tag validated correctly.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -