[IT-Terms] IV(Initializatin Vector)

2015. 2. 16. 23:37 - Song's IT

IV는 CBC운영모드로 평문 블록 암호화 시 직전 암호문 블록이 존재하지 않아 이를 대체할 목적으로 정해진 1개의 블록을 의미한다.

Section 1. 개요

When encrypting with CBC mode, the Initialization Vector (IV) is:

Random, Unpredictable, Not secret

CBC모드 암호화 시 IV는

난수 이어야하며, 예측할 수 없어야 하지만 비밀은 아니다.


There are three scenarios where an attacker could possibly abuse the IV:

공격자가 IV를 악용할 수 있는 3가지 시나리오가 있다.


Knowledge of the IV before encryption (predictable IVs).

Knowledge of the IV after encryption.

Ability to alter the IV before decryption.

암호화 전 IV벡터를 알 때. (예측가능한 IV벡터들)

암호화 후 IV벡터를 알 때.

복호화 전 IV벡터를 변경할 수 있을 때.


The next sections will discuss the security implications of an attacker with those capabilities.

다음 섹션은 위의 능력을 갖춘 공격자의 보안적인 의미에 대해 논할 것이다.


section 2. 랜덤하지 않고 예측가능한 IV

Statistical Correlations between IV and Plaintext

IV와 평문의 통계적인 상관관계


The IV must be random. To see why, consider what would happen if a counter, starting from zero, was used as an IV[1].

IV는 랜덤해야만 한다.

IV의 시작이 0일 경우 어떤 일이 발생하는 지 보자.


Suppose the first message sent is 0x0000000000000000. The IV would be 0x0000000000000000, so the input to the block cipher is 0x0000000000000000.

첫 번째 메시지가 0x0000000000000000으로 보내진다고 가정하자.

IV는 아마 0x0000000000000000일 것이고, 블록 암호문에도 0x0000000000000000이 들어갈 것이다.


Now, suppose a second message 0x0000000000000001 is encrypted

이제, 두 번째 메시지가 0x0000000000000001으로 보내진다고 가정하자.


This time, the IV is 0x0000000000000001, causing the input to the block cipher to be the same as before: 0x0000000000000000 (because 1 XOR 1 is 0).

이번에는, IV가 0x0000000000000001일 것이고, 블록 암호문에는 전과 같이 0x0000000000000000이 삽입 될 것이다. (1 XOR 1은 0이기 때문에)


So, both messages encrypt to the same ciphertext, which tells the adversary that they were different (since the IV is different, but the ciphertexts are the same)

그래서 두 메시지들은 같은 암호문으로 암호화 될 것이다.

그리고 그것은 공격자에게 암호문들이 다른 것을 알려줄 것이다.

(IV는 다르지만, 암호문은 같으므로.)


This shows how nonrandom IVs are more likely to correlate with the plaintext and leak information.

이것은 랜덤하지 않은 IV들이 평문과 더 상관관계를 갖고 정보를 유출할 수 있다는 것을 의미한다.


In general, whenever the first plaintext block is equal to the IV, the result will always be the encryption of 0x0000000000000000. If the adversary knows this value, they can look at a given (IV, ciphertext) pair and know whether or not the first block is the same as the IV. When the IV is random, it's much less likely for the IV to coincide with the first plaintext block by accident.

일반적으로, 첫 번째 평문 블록이 IV와 같다면, 결과는 언제나 0x000x0000000000000000일 것이다. 만약 공격자가 이 값을 알게 된다면, 그들은 주어진 한 쌍(IV, 암호문)을 볼 수 있고, 어쨌든 첫 번째 블록이 IV와 같다는 것을 알아 챌 수 있을 것이다. IV가 랜덤할 경우, 우연히라도 IV가 평문 블록과 일치하는 것을 알기가 훨씬 쉽지 않을 것이다.



section 3. 공격자가 암호화 후 IV를 알 경우

The IV's purpose is to ensure same plaintexts encrypt to different ciphertexts. When an adversary learns the IV after the plaintext has been encrypted, no harm is done, since it has already served its purpose.


The IV can be made public after encryption, without impacting the security of the system. Usually, it is prefixed to the ciphertext.

IV의 목적은 같은 평문데이터들을 다른 암호문으로 암호화 하는 것을 보장하는 것이다.

공격자가 평문이 암호화 된 후에 IV벡터를 습득하는 것은 전혀 문제가 되지 않는다.

이미 그것의 목적을 달성하였기 때문이다.


IV는 암호화 후에 시스템 보안상에 영향이 없는 공개된 것이 된다.


section 4. 공격자가 복호화 전 IV를 수정할 경우

If the adversary can alter the IV, without detection, before the ciphertext is decrypted, then they can corrupt the first block of plaintext. If the adversary knows the first block of plaintext is P and the original IV is OIV, and wants it to decrypt to Z, they can alter the IV to be P XOR Z XOR OIV, which will cause the first block to decrypt to Z (since (P XOR OIV) XOR (P XOR Z XOR OIV) = Z).

만약 공격자가 암호문이 복호화 되기 전 탐지당하지 않고 IV를 수정할 경우, 그들은 첫 번째 평문 블록을 알아낼 수 있다. 만약, 공격자가 첫 번째 평문이 P인 것을 알게 될 경우 원래의 IV가 OIV인 것을 알 수 있고, 그것을 Z로 복호화 할여, 그들은 IV를 P XOR Z XOR OIV로 변조할 수 있다. 그것은 첫 번째 불록이 Z로 복호화 된 것이다.

(P XOR OIV) XOR (P XOR Z XOR OIV) = Z)



'IT Tems' 카테고리의 다른 글

[IT Terms] MIME TYPE  (0) 2015.01.05
[IT Terms] ARM(Advanced RISC Machine) 프로세서  (0) 2014.12.29
[IT Terms] API / SDK / IDE / WST / ADT / AVD  (0) 2014.12.28

다른 카테고리의 글 목록

IT Tems 카테고리의 포스트를 톺아봅니다