2010-08-04 3 views
2

웹에 두 가지 알고리즘이 있습니다. 양 알고리즘암호문 도용 알고리즘 - 어느 쪽이 맞습니까?

는, 첫 번째 부분은 정말 한 이 하나 here에서 찍은 정확한지 몰라 ...

1. Pad the last partial plaintext block 
    with 0. 

2. Encrypt the whole padded plaintext 
    using the standard CBC mode. 

3. Swap the last two ciphertext blocks. 

4. Truncate the ciphertext to the length of the original plaintext 

그러나 해독, 두 가지 방법 ... 같다

1. If the ciphertext length is not a multiple of the block size, say it is n bits short, then pad it with the last n bits of the block cipher decryption of the last full ciphertext block. 
2. Swap the last two ciphertext blocks. 
3. Decrypt the ciphertext using the Cipher Block Chaining mode. 
4. Truncate the plaintext to the length of the original ciphertext. 

올바른 암호 해독 절차입니까? 이것이 첫 번째 암호화 부분에서 일어난 일을 되돌릴 수 있습니까? Wikipedia Article가 동일한 암호화 절차하지만 decryption is different

가 암호 전문가가 나에게 도움이 되거 수있다로

나는 혼란 스러워요? 고맙습니다 :

답변

4

두 설명은 동일하게 보입니다. 위키피디아 기사의 1 단계와 2 단계는 다른 기사의 첫 번째 단계와 같습니다. 위키 백과는 좀 더 공식적입니다.

+0

감사합니다. 그러나 Wikipedia는 IV로 0을 사용하여 해독한다고 말합니다. 그러나 다른 기사에서는 0을 IV로 사용하는 것에 대해서는 언급하지 않았습니다. 여기서 중요한 걸 놓치고 있니? –

+3

초기 벡터가 0 인 CBC 암호 해독은 블록 암호 해독과 동일 함을 알 수 있습니다. 위키피디아의 위 단락에 특히주의하십시오. "CBC 암호 텍스트 도용의 경우 표준 CBC 인터페이스를 사용하여 설명한 암호문 도용 프로세스를 구현하는 영리한 (하지만 불투명 한) 방법이 있습니다." 그 이전 섹션에는 7 단계 절차가 있으며 다른 설명과 일치합니다. – deinst

관련 문제