해시/암호화
AES Encrypt/Decrypt
비밀번호를 사용하여 AES-GCM 또는 AES-CBC로 텍스트를 암호화 및 복호화합니다(키는 PBKDF2로 유도됨).
AES is the standard for symmetric encryption: the same password is used to both encrypt and decrypt. This tool derives an encryption key from your password with PBKDF2 and encrypts text with AES-GCM or AES-CBC — all locally in your browser.
How to use it
- Encrypt: enter text and a password, pick a mode (GCM or CBC), and get an encrypted result along with the parameters (salt, IV) needed to decrypt it later.
- Decrypt: paste the encrypted text and the same password to get the original back.
- AES-GCM is the recommended default: it encrypts and verifies data integrity at the same time (authenticated encryption).
Common uses
- Encrypting sensitive text before storing it or sending it over an untrusted channel.
- Checking that an AES encryption implementation matches across different languages or libraries.
- A teaching example for understanding the difference between the GCM and CBC encryption modes.
Things to keep in mind
The IV (initialization vector) must be unique for every encryption performed with the same key — reusing a key+IV pair in GCM completely breaks the encryption's security.
AES-CBC without a separate integrity check (a MAC) is vulnerable to ciphertext-tampering attacks — that's why GCM, which combines encryption and authentication in one mode, is the safer default.
자주 묻는 질문
AES-GCM과 AES-CBC 중 무엇을 선택해야 하나요?
AES-GCM은 암호화와 동시에 무결성 인증까지 제공하는 인증 암호화 방식이라 대부분의 경우 권장됩니다. AES-CBC는 별도의 무결성 검증 수단이 없어 상호 운용성이 필요한 경우가 아니라면 GCM을 사용하는 것이 좋습니다.
비밀번호를 그대로 AES 키로 사용하나요?
아니요. 입력한 비밀번호는 PBKDF2로 유도(key derivation) 과정을 거쳐 AES 키로 변환됩니다. 비밀번호를 직접 키로 쓰는 것보다 무차별 대입 공격에 훨씬 강합니다.
같은 IV(초기화 벡터)를 재사용해도 괜찮나요?
절대 안 됩니다. 같은 키로 같은 IV/nonce를 재사용하면 암호문의 기밀성과 무결성이 심각하게 훼손될 수 있습니다. 이 도구는 암호화할 때마다 새로운 IV를 생성합니다.
ECB 모드를 사용하면 안 되는 이유는 무엇인가요?
ECB는 각 블록을 독립적으로 동일한 방식으로 암호화하므로, 동일한 평문 블록은 동일한 암호문 블록을 만들어냅니다 — 이는 데이터의 구조를 그대로 노출합니다(예: 이미지의 반복 패턴이 암호화 후에도 그대로 보임). 고유한 IV를 사용하는 CBC나 GCM은 이 문제를 해결합니다.
같은 키로 동일한 IV를 재사용하면 어떻게 되나요?
GCM에서는 치명적인 실수입니다 — 키+IV 조합을 재사용하면 암호화의 기밀성과 무결성이 완전히 무너집니다. IV는 같은 키로 암호화할 때마다 항상 고유해야 합니다.