Galois/Counter Mode (GCM) is a block cipher mode of operation providing both confidentiality and data origin authentication. It was designed by McGrew and Viega [MCGR05], is free of patents, and is recommended by NIST [SP800-38D].
Security considerations: There are some security weaknesses if GCM mode is used incorrectly and the user is referred to NIST Special Publication 800-38D for more guidance. GCM is not suited for use with short tag lengths or a very long message (>64 GB - so not an issue here). The user should monitor and limit the number of unsuccessful verification attempts for each key. It is strongly recommended to use all 16 bytes for the tag, and generally no less than 8 (we impose a minimum requirement of 4 bytes). The same length of tag must always be used for a given key. The IV must be unique for each operation for a given key. Security is destroyed for all text encrypted with the same key if you ever use the same IV for different plaintext. Using a 12-byte randomly-generated IV is OK, and so is a counter that you have control over so that it can never be repeated (even after a power recycle or system crash!). There is more guidance on constructing unique IVs in section 8 of [SP800-38D]. We give you the basic tool; it's sharp; use it carefully.