info/aes-256-gcm.html

Last modified Wed Nov 10 05:58:27 UTC 2021


<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<title>What is AES-256-GCM | Safe Crypt App</title>
	<link rel="canonical" href="https://crypt-app.net/info/aes-256-gcm.html" />
	<link rel="stylesheet" href="../assets/css/info.css">
</head>
<body>
	<h1><span class="circle">i</span>&nbsp; What is AES-256-GCM?</h1> 
	
	<div class="hyphenate">

	<p>

	<span class="ok">AES</span>, the Advanced Encryption Standard, 
 	is the current U.S. government standard for a
 	<em>symmetric-key encryption algorithm</em>.

	A&nbsp;symmetric-key algorithm, also known as a secret key algorithm,
	is a cryp&shy;togra&shy;phy algorithm that uses the same cryp&shy;togra&shy;phic key
	for both plaintext encryption and ciphertext decryption.
	</p>

	<p>
	AES has a block size of 128 bits and can have a key size of
	128, 192, or 256 bits.

	AES is defined in the U.S. 
	<a href="https://doi.org/10.6028/NIST.FIPS.197">
	Federal Information Processing Standard (FIPS) 197</a><span class="pdf">&nbsp;PDF</span><span class="linkout">*</span>
	and it is included in the ISO/IEC 18033-3 standard.

	It can be implemented in either software or hardware.

	Modern web browsers provide a low-level interface to cryp&shy;togra&shy;phy
	functions via the <a href="https://www.w3.org/TR/WebCryptoAPI/">
	W3C Web Cryp&shy;togra&shy;phy&nbsp;API</a><span class="linkout">*</span>.

	This <a href="../index.html">web app</a> uses a key size of <span class="ok">256</span> bits, 
	which is currently considered strong enough to protect U.S. government sensitive and important data.
	
	In this app, the key is generated from a passphrase by running it through the
	<em>Password-Based Key Derivation Function&nbsp;2</em> (PBKDF2, defined in IETF's 
	<a href="https://tools.ietf.org/html/rfc2898">RFC 2898</a><span class="linkout">*</span>) one million times. 

	</p>

	<p>

	AES in <a href="https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf">
	Galois/Counter Mode</a><span class="pdf">&nbsp;PDF</span><span class="linkout">*</span> or 
	<span class="ok">GCM</span> is an <em>authenticated encryption</em> algorithm
	(AEAD, authenticated encryption with associated data).
	
	It provides confidentiality and integrity protection by
	generating both the ciphertext and an authentication tag in a single pass.

	During decryption, the ciphertext and the authentication tag are passed 
	through the algorithm.

	If the calculated and expected authentication tags do not match, 
	decryption fails.

	Unlike the commonly used CBC mode, GCM is not susceptible to 
	<a href="https://www.iacr.org/cryptodb/archive/2002/EUROCRYPT/2850/2850.pdf">
	padding oracle attacks</a><span class="pdf">&nbsp;PDF</span><span class="linkout">*</span>.

	Nor has it the problems of ECB mode, which can 
	<a href="https://blog.cryptographyengineering.com/2011/12/01/how-not-to-use-symmetric-encryption/">
	reveal structures in the plaintext</a><span class="linkout">*</span>.

	However, <a href="https://www.nist.gov/">NIST</a><span class="linkout">*</span>
	<a href="https://csrc.nist.gov/publications/detail/sp/800-38d/final">recom&shy;mends</a><span class="linkout">*</span>
	we should not encrypt more than 2<sup>32</sup> plaintexts 
	with the same key while using a randomly generated <em>initialization vector</em> IV,
	like this app does.
	If we restrict the number of plaintexts to 10000, 
	the probability of an IV collision is less than 2<sup>-70</sup>.

<!--	<a href="https://cr.yp.to/hash/collisioncost-20090823.pdf"></a><span class="linkout">*</span> -->

	</p>
	
	<h2>Bans and restrictions</h2>

	<p>

	Some countries have banned the import or use of strong cryp&shy;togra&shy;phy, such as 256 bit AES.
	No up-to-date list of these countries seems to be available, 
	but we believe the list to include at least 
	Belarus, Brunei Darussalam, China, Iraq, Mongolia, Myanmar (Burma), North Korea, Russia, Tunisia, Turkmenistan, 
	and Uzbekistan. 
	Some other countries may require a special license.  
	Notice that this app <em>does not contain cryptographic functions</em>, they are provided by your web browser.

	</p>
	</div>

	<div class="back"><a href="./index.html">BACK</a></div>
</body>
</html>