Hashe/Krypto
AES Encrypt/Decrypt
Szyfruj i deszyfruj tekst za pomocą AES-GCM lub AES-CBC z użyciem hasła (klucz wyprowadzany przez 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.
Artykuł o tym narzędziu: AES: jak działa szyfrowanie symetryczne
Najczęstsze pytania
Jakie rozmiary kluczy obsługuje tu AES i którego użyć?
AES obsługuje klucze 128, 192 i 256-bitowe. AES-256 to typowa rekomendacja dla nowych aplikacji — 128 bitów uznawane jest już za bezpieczne, ale 256 bitów daje dodatkowy margines przy znikomym praktycznym koszcie.
Jaka jest różnica między trybami szyfrowania (np. CBC, GCM)?
GCM uwierzytelnia szyfrogram podczas szyfrowania, więc wykrywa też manipulację, dlatego jest zalecanym domyślnym wyborem. CBC tylko szyfruje i wymaga osobnego MAC dla integralności oraz losowego IV przy każdym szyfrowaniu, by pozostać bezpiecznym.
Czy mój klucz lub tekst jawny jest gdzieś wysyłany?
Nie. Całe szyfrowanie i deszyfrowanie odbywa się lokalnie w Twojej przeglądarce za pomocą Web Crypto API — nic nie jest wysyłane na serwer.
Dlaczego nie warto używać trybu ECB?
ECB szyfruje każdy blok niezależnie i tak samo, więc identyczne bloki tekstu jawnego dają identyczne bloki szyfrogramu — to ujawnia strukturę danych (na przykład powtarzające się wzory na obrazie pozostają widoczne nawet po zaszyfrowaniu). CBC lub GCM z unikalnym IV eliminują ten problem.
Co się stanie, jeśli ponownie użyje się tego samego IV z tym samym kluczem?
W przypadku GCM to krytyczny błąd — ponowne użycie pary klucz+IV całkowicie kompromituje poufność i autentyczność szyfrowania. IV zawsze musi być unikalny dla każdego szyfrowania z tym samym kluczem.