하드코딩된 암호화 IV
Use of Hardcoded Cryptographic Initialization Value
설명
잠재적 영향
해결 방법
취약한 코드 및 안전한 코드 예시
취약한 코드
# Unsafe AES encryption with hardcoded IV
from Crypto.Cipher import AES
key = os.getenv("ENCRYTION_KEY").encode()
cipher = AES.new(key, AES.MODE_CBC, b'This is an IV456') # 하드코딩된 IV
plaintext = b'This is a secret message.'
ciphertext = cipher.encrypt(plaintext)안전한 코드
참조
Last updated