

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
click for more info
Not enough gems
Cost: 6 gems
1: Advanced Encryption Standard
incomplete
2: Advanced Encryption Standard
incomplete
3: Nonces
incomplete
4: Nonce Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
AES is a block cipher just like DES, but there are some key differences:
AES uses 128, 192, or 256 bit keys. DES uses 56 bit keys
AES block size is 128 bits, DES block size is 64 bits
DES is insecure by modern standards, AES is still considered secure
AES uses a subs-perm network, DES uses Feistel
When working with DES, we used CBC, or Cipher Block Chaining mode. When working with AES, we'll be using GCM, or Galois Counter Mode. While AES also supports CBC, GCM has a couple of properties that make it more suitable for production use:
There is no need to fuss with block padding. GCM is built on counter mode, which encrypts data of any length without padding
GCM supports authenticated encryption. GCM decryption will fail if the ciphertext was tampered with, or if it wasn't encrypted with our key in the first place
At Passly, the production cipher we use to encrypt password values is AES in GCM mode! Complete the decrypt function.
Create a new cipher block using the key.
Use the cipher block to create a new GCM
Use the GCM (which implements the AEAD interface) to decrypt the ciphertext using aesgcm.Open
Return the plaintext as a []byte
Return any errors that occur without modifying them.