0% found this document useful (0 votes)
3 views4 pages

AES_Notes

AES (Advanced Encryption Standard) is a symmetric block cipher that encrypts data in fixed-size 128-bit blocks using key sizes of 128, 192, or 256 bits. It operates through a series of transformations including SubBytes, ShiftRows, and MixColumns, with a defined number of rounds based on the key size. AES is widely used for securing data in various applications, including blockchain systems for wallet key encryption and data transport.

Uploaded by

SkillBridgeDocs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

AES_Notes

AES (Advanced Encryption Standard) is a symmetric block cipher that encrypts data in fixed-size 128-bit blocks using key sizes of 128, 192, or 256 bits. It operates through a series of transformations including SubBytes, ShiftRows, and MixColumns, with a defined number of rounds based on the key size. AES is widely used for securing data in various applications, including blockchain systems for wallet key encryption and data transport.

Uploaded by

SkillBridgeDocs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AES (Advanced Encryption Standard)

1. What is AES?
AES is a symmetric block cipher — the same secret key is used to both encrypt and decrypt data. It was selected
by NIST in 2001 (originally called Rijndael) as the successor to DES, and is now the global standard for
symmetric encryption.
● Symmetric → sender and receiver must already share the same secret key
● Block cipher → data is encrypted in fixed-size chunks (blocks), not one bit/byte at a time
● Block size: always 128 bits (16 bytes), regardless of key size
● Key sizes: 128, 192, or 256 bits — this determines the variant name (AES-128, AES-192, AES-256)

2. Core Concepts
Term Meaning
State The 128-bit block of data, arranged as a 4x4 grid of bytes
Round One full pass of transformations applied to the state
Round key A unique sub-key used in each round, derived from the main key
Key schedule The algorithm that expands the original key into all round keys
S-box A fixed lookup table used to substitute bytes non-linearly

3. Number of Rounds by Key Size


Variant Key size Number of rounds
AES-128 128 bits 10
AES-192 192 bits 12
AES-256 256 bits 14

More key bits → more rounds → larger security margin.

4. The Encryption Process (Step by Step)


Plaintext (128-bit block)
|
v
AddRoundKey (Round 0)
|
v
+--------------------+
| Rounds 1-9: |
| SubBytes |
| ShiftRows |
| MixColumns |
| AddRoundKey |
+--------------------+
|
v
Final Round (10):
SubBytes
ShiftRows
AddRoundKey <- no MixColumns
|
v
Ciphertext

Step details
AddRoundKey (Round 0)
XOR the plaintext with the first round key before any transformation. Prevents the very first SubBytes step from
operating on raw, predictable plaintext.
SubBytes
Every byte in the state is replaced using a fixed substitution table (the S-box). This introduces non-linearity —
makes the relationship between key and ciphertext impossible to approximate with simple algebra. This is the
“confusion” property.
ShiftRows
Each row of the 4x4 state is cyclically shifted left by a different offset (row 0: no shift, row 1: shift by 1, row 2:
by 2, row 3: by 3). Spreads bytes across columns.
MixColumns
Each column is multiplied by a fixed matrix over the finite field GF(2^8). Every output byte in a column depends
on all four input bytes — this is the “diffusion” property. Skipped in the final round.
AddRoundKey
XOR the state with that round's unique round key, tying the transformation to the secret key.

Why the final round skips MixColumns


Without it, encryption and decryption become structurally symmetric — simplifying implementation, since the
last step doesn't need extra “un-mixing.”

5. Why a Matrix Structure?


A) The 4x4 state grid (data organization)
The 128-bit block is arranged as:
b0 b4 b8 b12
b1 b5 b9 b13
b2 b6 b10 b14
b3 b7 b11 b15

This 2D layout is required because ShiftRows operates on rows and MixColumns operates on columns — a flat
byte array couldn't support either operation.

B) Matrix multiplication in MixColumns (the math)


Each column is multiplied by a fixed matrix:
[2 3 1 1] [b0]
[1 2 3 1] x [b1]
[1 1 2 3] [b2]
[3 1 1 2] [b3]
● Arithmetic happens in GF(2^8): “addition” = XOR, multiplication follows finite-field rules
● Guarantees every output byte depends on every input byte in the column — diffusion by construction
● This is an MDS matrix (Maximum Distance Separable) — proven to give the best possible spread for a 4x4 linear
transform

6. Key Schedule (Key Expansion)


The original cipher key is expanded into a separate round key for every round, using:
● Byte rotation
● S-box substitution
● XOR with round constants (Rcon)
This ensures each round uses different, unpredictable key material even though it all derives from one original
key.

7. Decryption
Decryption runs the same structure in reverse, using inverse operations:
● InvShiftRows
● InvSubBytes
● InvMixColumns
● Round keys applied in reverse order

8. AES in Practice: Common Modes


AES itself only encrypts a single 128-bit block. To encrypt real (larger) data, it's combined with a mode of
operation:
Mode Notes
ECB Insecure — identical plaintext blocks produce identical ciphertext blocks. Avoid.
CBC Each block XORed with the previous ciphertext block; needs an IV
CTR Turns AES into a stream cipher; parallelizable
GCM CTR mode + built-in authentication (confirms data wasn't tampered with) — widely
recommended

9. AES in Blockchain Systems


AES is not used for consensus, mining, or transaction signing — those rely on hash functions (SHA-256, Keccak)
and asymmetric cryptography (ECDSA, EdDSA). AES plays a supporting role:
● Wallet key encryption — private keys stored in keystore files are encrypted with AES (e.g., Ethereum keystores use
AES-128-CTR by default)
● Passphrase-based protection — a user passphrase is run through a key derivation function (PBKDF2, scrypt,
Argon2) to produce an AES key, which then encrypts the private key
● Node-to-node transport — AES secures data in transit within TLS connections between peers
● Off-chain/private data — in permissioned blockchains (e.g., Hyperledger Fabric), sensitive payloads may be AES-
encrypted with only a hash committed on-chain
Key distinction: blockchains need asymmetric crypto for identity/signing (verifiable by anyone without a shared
secret); AES is symmetric and used wherever both parties already share a secret — protecting data at rest or in
transit, not the ledger's core trust mechanism.
10. Quick Summary Table
Property Value
Type Symmetric block cipher
Block size 128 bits
Key sizes 128 / 192 / 256 bits
Rounds 10 / 12 / 14
Core operations SubBytes, ShiftRows, MixColumns, AddRoundKey
Security goal Confusion (SubBytes) + Diffusion (ShiftRows, MixColumns)
Common modes CBC, CTR, GCM
Blockchain role Wallet/key encryption, transport security, private data — not consensus

You might also like