MAC (메시지 인증 코드)
무결성 : 공격자는 비밀 키가 필요하기 때문에 데이터를 수정 한 다음 새 MAC을 계산할 수 없습니다.
인증 : 비밀 키를 가지고있는 사용자 만 메시지를 인증 할 수 있습니다.
대칭 암호화
기밀성 : 데이터가 암호화 됨
인증 : 2 명의 사용자 만이 비밀 키를 공유합니다.
갈로 아 / 카운터 모드 (GCM)는 관련 데이터로 인증 된 암호화입니다.
GCM은 블록 크기가 128 비트 인 승인 된 대칭 키 블록 암호로 구성됩니다.
GCM은 NIST Special Publication 800-38D에 정의 된 범용 해시 기능을 사용하여 기밀 데이터의 신뢰성을 보장합니다.
인증 된 암호화 솔루션
암호화
블록 암호 AES의 사용
CTR과 유사한 운영 모드
인증
제공된 MAC은 일종의 키순 요약(다이제스트)입니다.
인증 만 제공 할 수 있습니다 → GMAC
기밀성과 무결성에 사용
메시지의 암호화되지 않은 선택적 부분 (예 : 네트워크 패킷 헤더)이있을 수 있습니다.
무결성 검사 값 (ICV)은 암호문 (일반 텍스트가 아님)에 대해 계산됩니다. DoS (Denial of Service) 공격 대응으로 네트워크 트래픽 보호에 효과적입니다.
기밀 유지 및 무결성을위한 가장 빠른 모드
이 모드에 대한 특수 Intel 및 AMD 프로세서 어셈블러 명령 (PCLMULQDQ)
길이 확장 공격 보호
무결성 검사를 위해 약한 키가있을 수 있음
매우 빠른 속도, 10Gbps 이상
소프트웨어 및 하드웨어로 구현하기 쉽습니다.
원하는 경우에만 인증에 사용할 수 있습니다.
128 비트로 최적화 된 AES 용으로 설계되었습니다.
96 비트에 최적화 된 임의 길이 IV.
인증 및 암호화를위한 단 하나의 키.
지적 재산권 금지.
Gctr와 ghash 합친 상태이다.
0의 128승 초기 비트이며, IV or n 형식의 카운트형식으로 계속 간다.
거기에 Ghash을 값을 섞어 위와 같은 그림을 볼 수 있다.
앞에와 비슷하지만 해쉬함수의 초기벡터 0의 32승이 포함된 모습을 볼 수 있고,
authentication tag(TAG) 을 통해 인증할 수 있는 것이 추가되었다.
1. H = CIPHK (0128)라고합시다.
2. 다음과 같이 블록 J0을 정의하십시오.
len (IV) = 96이라면, J0 = IV || 031 || 1.
len (IV) ≠ 96이라면 s = 128 [len (IV) / 128] -len (IV)이라고하고,
J0 = GHASHH (IV || 0s + 64 || [len (IV)] 64).
3. C = GCTRK (inc32 (J0), P)
4. u = 128이면, [len (C) / 128] -len (C) 및 v = 128로한다. [len (A) / 128] -len (A)
5. 다음과 같이 블록 S를 정의하십시오.
S = GHASHH (A || 0v || C || 0u || [len (A)] 64 || [len (C)] 64).
6. T = MSBt (GCTRK (J0, S))
7. Return (C, T)
References
Morris Dworkin, “Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC”, NIST, 2007
David A. McGrew, John Viega, “The Galois/Counter Mode of Operation (GCM)”,
Sharon S. Keller, Timothy A. Hall, “The Galois/Counter Mode (GCM) and GMAC Validation System (GCMVS) with the Addition of XPN Validation Testing”, National Institute of Standards and Technology, 2016
Vidder,"Galois/Counter Mode (GCM) and GMAC",youtube,2016
2. 1. MAC and Symmetric encryption
2. Galois/Counter Mode (GCM)
3. GCM and GMAC
3. • MAC(Message Authentication Code)
– Integrity: an attacker can’t modify the data and then
compute a new MAC, because a secret key is needed
– Authentication: only the user who has got the secret
key can authenticate the message
• Symmetric encryption
– Confidentiality: data are encrypted
– Authentication: if only 2 users share the secret key
4. • Galois/Counter Mode (GCM) is authenticated
encryption with associated data.
• GCM is constructed from an approved symmetric
key block cipher with a block size of 128 bits.
• GCM provides assurance of the authenticity of
the confidential data using a universal hash
function that is defined over a NIST Special
Publication 800-38D.
5. • An authenticated encryption solution
• Encryption
– Use of the block cipher AES
– Mode of operation similar to the CTR
• Authentication
– The MAC provided is a sort of keyed digest
– Can provide authentication only → GMAC(Galois MAC)
6. • used for confidentiality and integrity
• there may be present optional not encrypted part of message
(A): e.g., network packet headers
• computation of integrity check value (ICV) is made over the
ciphertext (not plaintext): effective for network traffic protection
with denial-of-service (DoS) attack countermeasures
• the fastest mode for confidentiality and integrity
• special Intel and AMD processor assembler instruction
(PCLMULQDQ) for this mode supports
• length extensions attack protected
• small amount of weak keys may exist for integrity check
7. • Extremely fast, more than 10Gbps
• Easy to implement in software and hardware.
• Can be used for authentication only, if desired.
• Designed for AES, optimized for 128 bits.
• Arbitrary length IV, optimized for 96 bits.
• Only one key for authentication and encryption.
• No intellectual property restrictions.
10. 1. If X is the empty string, then return the empty string as Y
2. Let n=[len(X)/128]
3. Let X1, X 2, ... , X n-1, X*n denote the unique sequence of
blocks such that X = X 1 || X 2 || ... || X n-1 || X*n
4. X1, X2,..., Xn-1 are complete blocks.
Consequently, Xn* is either a complete block or a nonempty
partial block, and if 1 ≤ len(X) ≤128, then X = X1*
5. Let CB1=ICB
11. 6. For i = 2 to n, let CBi = inc32(CBi-1)
7. For i=1 to n-1, let Yi=Xi⊕CIPHK(CBi)
8. Let Y*n=X*n⊕MSBlen(X*n)(CIPHK(CBn))
9. Let Y= Y1||Y2||…||Y*n
10. Return Y
12. • GHASHH
• Let X1, X 2, ... , X m-1, X m
denote the unique sequence
of blocks such that X = X 1 ||
X 2 || ... || X m-1 || X m
• Let Y0 be the “zero block”,
0128
• For i = 1, ..., m,
let Yi = (Yi-1 ⊕ Xi) • H
• Return Ym
16. 1. Let H = CIPHK(0
128
).
2. Define a block, J0, as follows:
If len(IV)=96, then let J0 = IV || 0
31
||1.
If len(IV) ≠ 96, then let s = 128[len(IV)/128]–len(IV), and let
J0=GHASHH(IV||0
s+64
||[len(IV)]64).
3. Let C=GCTRK(inc32(J0), P)
4. Let u = 128 . [len(C)/128]–len(C) and let v = 128 . [len(A)/128]–len(A)
5. Define a block, S, as follows:
S = GHASHH (A || 0
v
|| C || 0
u
|| [len(A)]64 || [len(C)]64).
6. Let T = MSBt(GCTRK(J0,S))
7. Return (C, T)
20. • Morris Dworkin, “Recommendation for Block Cipher Modes of
Operation: Galois/Counter Mode (GCM) and GMAC”, NIST, 2007
• David A. McGrew, John Viega, “The Galois/Counter Mode of
Operation (GCM)”,
• Sharon S. Keller, Timothy A. Hall, “The Galois/Counter Mode
(GCM) and GMAC Validation System (GCMVS) with the Addition
of XPN Validation Testing”, National Institute of Standards and
Technology, 2016
• Vidder,"Galois/Counter Mode (GCM) and GMAC",youtube,2016