Skip to content

Instantly share code, notes, and snippets.

@aegiap
Created April 14, 2021 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aegiap/2259ed446c04b73abdb7b8be1b8eee3e to your computer and use it in GitHub Desktop.
Save aegiap/2259ed446c04b73abdb7b8be1b8eee3e to your computer and use it in GitHub Desktop.
AES-CBC vs AES-GCM
Until recently the only AES cipher that you were likely to encounter in the VPN world was AES-CBC (Cipher Block Chaining).
This refers to the block cipher mode, a complex subject that is not really worth going into here.
Although CBC may theoretically have some vulnerabilities, the consensus is that CBC is secure. CBC is, indeed, recommended
in the OpenVPN manual.
OpenVPN now also supports AES-GCM (Galios/Counter Mode). GCM provides authentication, removing the need for an HMAC SHA
hashing function. It is also slightly faster than CBC because it uses hardware acceleration (by threading to multiple
processor cores).
AES-CBC remains the most common mode in general use, but AES-GCM is increasing in popularity. Given the advantages of
GCM, this trend is only likely to continue. From a cryptographic perspective, though, both AES-CBC and AES-GCM are highly
secure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment