關於部落格
心寬念純●一生懸命●大願成就●幸福長久
  • 131653

    累積人氣

  • 20

    今日人氣

    1

    追蹤人氣

AES (ADVANCED ENCRYPTION STANDARD)

雖然... Symmetric Encryption概念簡單到爆!!!
而... AES就是基於Symmetric Encryption概念所設計來的演算法!!!
 
       始終使用同一把金鑰來加解密

 Let's Practice with Secret Key Encryption

 
然而... AES其實作一點都不簡單!!!
@ 取代(substitution)/置換(transposition)/相乘(Product)通通都得運用上!
 
 Recap~ 密碼學上的幾個重要Idea:
 
Big Idea #1: Confusion(混亂性) (把你拷糊塗... 讓你猜不透...)

Big Idea #2: Diffusion(擴張性) (牽一髮而動全身的概念)

Big Idea #3: Secrecy Only in the Key!!!


8-) 就是因為Big Idea #3
Combo™必須借用谷歌大神 + Wiki百科來理解AES的運作原理~

How Does AES Work?

蹲馬步 @ AES演算法四大基本步驟:

1.) AddRoundKey: 基本上就是互斥或運算 (⊕)


            AES ❤ XOR

2.) SubBytes: S-Box查表

 ► S-Box (Substitution-Box)

(左) S-Box Lookup Table    (右) Inv S-Box Lookup Table


3.) ShiftRows: 乾坤大挪移

AES_ShiftRowTab[] = { 0,5,10,15,4, 9,14,3,8,13,2,7,12,1,6,11 };
  
         



4.) MixColumns: 合而為一

a'(x)=a(x)⊗c(x)
a'0,c = ({02}•a0,c) ⊕ ({03}•a1,c) ⊕ a2,c ⊕ a3,c
a'1,c = a0,c ⊕ ({02}•a1,c) ⊕ ({03}•a2,c) ⊕ a 3,c
a'2,c = a0,c ⊕ a1,c ⊕ ({02}•a2,c) ⊕ ({03}•a3,c)
a'3,c = ({03}•a0,c) ⊕ a1,c ⊕ a2,c ⊕ ({02}•a3,c)




( 其中ShiftRows&MixColumns兩步驟為AES密碼系統提供了Diffusion(擴散性)!!!)


The Laws of Cryptography: AES Key Expansion
AES Key Expansion = Rijndael Key Schedule


Flash Video Describing the AES key schedule:
http://www.formaestudio.com/rijndaelinspector/archivos/Rijndael_Animation_v4_eng.swf

(A) Encryption Process @ Page 4
(B) Key Schedule          @ Page 14


@ Youtube


@ AES Encryption 1: Intro and Outline

Encryption Process:

Flash Video Describing the AES key schedule @ Page 4



Key Expansion:

Flash Video Describing the AES key schedule @ Page 14





11, 13, 15 rounds for 128, 192, 256 bits keys
  - First Round
  - Main Regular Rounds (9, 11, 13)
  - Final Round (10th, 12th, 14th)


AES-128 = Expansion of the given Cipher key into 11 partial keys
                                        (Initial round + 9 main rounds + final round)
AES-192 = Expansion of the given Cipher key into 13 partial keys
                                        (Initial round + 11 main rounds + final round)
AES-256 = Expansion of the given Cipher key into 15 partial keys 
                                        (Initial round + 13 main rounds + final round)

(⊕) xor with "Round Constant":

RCON[i]=[Rcon[i],00,00,00]RCON[i]=[Rcon[i],00,00,00] ; xi1x i1 (for i from 0 to 255)

RCON [0] = 0x8d is not used in AES algorithm.
RCON [1] = 0x01, RCON [2] = 0x02, RCON [3] = 0x04, RCON [4] = 0x08, RCON [5] = 0x10,
RCON [6] = 0x20, RCON [7] = 0x40, RCON [8] = 0x80, RCON [9] = 0x1B, RCON [10] = 0x36,
RCON [11] = 0x6C, RCON [12] = 0xD8, RCON [13] = 0xAB, RCON [14] = 0x4D.


 AES是一種標準1 AES是一種標準!! AES是一種標準!!!
因為是Standard! 所以Intel Inside就把"AES Inside" since Westmere

Intel® 進階加密標準新增指令 (Intel® AES NI) 是一組新的加密指令集,
改善了進階加密標準 (AES) 演算法,可加速 Intel® Xeon® 處理器產品與
Intel® Core™ 處理器產品中的資料加密。
1. 好的演算法,亦即「進階加密標準」(AES) @ Intel® AES NI
2. 好的金鑰,亦即優質的隨機數字 @ Intel® Digital Random Number Generator,Intel® DRNG)
Intel® Advanced Encryption Standard (Intel® AES) Instructions Set

AES Encryption & Decryption Flow:


AES Encryption Flow:
 
(0). KeyExpansion()
(1). Round #1
    1. AddRoundKey()
(2). Regular Rounds (9, 11, 13) depend on Keys used
    1. SubBytes()
    2. ShiftRows()
    3. MixColumns()
    4. AddRoundKey()
(3). Last Round
    1. SubBytes()
    2. ShiftRows()
    3. AddRoundKey()



AES Decryption Flow:
 
(0). KeyExpansion()
(1). Round #1
    1. AddRoundKey()
(2). Regular Rounds (9, 11, 13) depend on Keys used
    1. InvShiftRows()
    2. InvSubBytes()
    3. AddRoundKey()
    4. InvMixColumns()
(3). Last Round
    1. InvShiftRows()
    2. InvSubBytes()
    3. AddRoundKey()
 
1. Each round = 4 steps of SubBytes, ShiftRows, MixColumns, and AddRoundKey.
2. Last round has only 3 steps. No MixColumns.
3. Decryption is not the same as encryption (as in DES).
4. Decryption consists of inverse steps.


ComboStyle™AES網誌的最後...
 
8-) 比利時不只是有美味高檔的GADIVA巧克力...
還有迷人奧秘的Rhine doll @ AES (Advanced Encryption Standard)!!!

:-( 回到AES的最初是... 數學!!!
其原理果然奧秘!!! (AES裡面有不少數學理論存在, 特別是有關數論的理論)





Block Ciher Mode:

           CBC better than ECB

Block cipher mode of operation
https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
http://blog.poxiao.me/p/advanced-encryption-standard-and-block-cipher-mode/

How secure is AES against brute force attacks?




                                    AES果然是奧秘!!!
                           
byAJPnOPiTLuGHQUlHu/jTD8U9T/G8F64T/K0+4Bq4JgmUmjq/8PyCgiuZdZJoEk
 
               by Online AES encryption tools @ Seccret Key: 1216





             

Crypto-Toolbox
https://www.3amsystems.com/Crypto-Toolbox

AES Crypt
https://www.aescrypt.com/

Cryptography - 256 bit Ciphers
http://embeddedsw.net/Cipher_Reference_Home.html

A Stick Figure Guide to the Advanced Encryption Standard (AES)
http://sacoinvest.blogspot.tw/2009/09/stick-figure-guide-to-advanced.html

 
 
相簿設定
標籤設定
相簿狀態