camellia-192-ecb encrypt & decrypt online
LegacyEncrypt or decrypt text with camellia-192-ecb and a secret. Same result as PHP's openssl_encrypt, and nothing leaves your browser.
The bytes behind your result
Your code gives a different result? Almost always the key or the IV differ. Here you see exactly which bytes the tool used for the secret and text in the tool above: copy the key and IV in hex into your own code. Shown for the text hello world and the secret my secret until you type above.
- Key · 24 bytes 9 from your secret, 15 zero bytes added
- 6d7920736563726574000000000000000000000000000000
6d7920736563726574000000000000000000000000000000 - IV
- not used by this mode
- Text in UTF-8 11 bytes of text + 5 bytes PKCS#7 padding (value
05) = 16 bytes, 1 block of 16 - 68656c6c6f20776f726c640505050505
- Encrypted · 16 bytes
- d8fc9fd5642030ae92ab497518737719
d8fc9fd5642030ae92ab497518737719 - As Base64 what the tool shows
2Pyf1WQgMK6Sq0l1GHN3GQ==
from your inputzero bytespaddingciphertext
What is camellia-192-ecb?
Camellia is a block cipher by Mitsubishi Electric and NTT (2000), approved by ISO/IEC, the EU's NESSIE project and Japan's CRYPTREC. It is considered as strong as AES, with 16-byte blocks and 128, 192 or 256-bit keys. Camellia-192-ECB uses a 192-bit key (24 rounds) in Electronic Codebook mode: every block is encrypted on its own, so equal blocks give equal output.
How your secret becomes the key
Camellia-192-ECB needs exactly 24 bytes (192 bits) of key. The tool takes your secret as UTF-8 bytes and pads it with zero bytes to 24 bytes, or cuts it after 24 bytes.
- TLS cipher suites (RFC 5932)
- OpenPGP and GnuPG
- Japanese government systems
Is it safe to use?
Camellia. No practical attack on the cipher itself is known.
The setup of this tool is made for compatibility with PHP's openssl_encrypt, not for protecting secrets: the IV is always zero, the secret is used as the key without a key derivation function, and nothing detects changes to the ciphertext.
For real secrets use an authenticated mode such as AES-256-GCM or ChaCha20-Poly1305 with a fresh random nonce for every message, and derive the key from a password with Argon2id, scrypt or PBKDF2. What is a key derivation function?
How ECB mode works
ECB encrypts each 16-byte block separately with the same key. There is no IV and no chaining.
Equal plaintext blocks therefore give equal ciphertext blocks. Patterns in the data stay visible, the classic example is an encrypted image whose outlines you can still see. Never use ECB for more than one block of real data.
Like CBC, ECB pads the last block with PKCS#7, so the output is a multiple of 16 bytes.
Really calculated: each square is one 16-byte block, coloured by the first byte of its ciphertext. With ECB, equal blocks stay equal and the heart shows through. With CBC, every block depends on the one before.
The same result in your code
Every snippet prints 2Pyf1WQgMK6Sq0l1GHN3GQ== for the text hello world and the secret my secret, the same as the tool. The key and IV are written out in hex, so you can see what the tool does with the secret. Your own key and IV are in What the tool did. All snippets are run against PHP before each release.
$key = hex2bin("6d7920736563726574000000000000000000000000000000"); // "my secret" padded with zero bytes to 24 bytes echo openssl_encrypt("hello world", "camellia-192-ecb", $key, 0);
Shortest form, same result: openssl_encrypt("hello world", "camellia-192-ecb", "my secret"). PHP pads the secret itself but warns about the empty IV.
# pip install cryptography import base64 from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives import padding key = bytes.fromhex("6d7920736563726574000000000000000000000000000000") # "my secret" padded with zero bytes to 24 bytes data = "hello world".encode() padder = padding.PKCS7(128).padder() data = padder.update(data) + padder.finalize() enc = Cipher(algorithms.Camellia(key), modes.ECB()).encryptor() print(base64.b64encode(enc.update(data) + enc.finalize()).decode())
Python has no AES in the standard library; cryptography is the common package for it.
import { createCipheriv } from 'node:crypto'; const key = Buffer.from("6d7920736563726574000000000000000000000000000000", 'hex'); // "my secret" padded with zero bytes to 24 bytes const c = createCipheriv("camellia-192-ecb", key, null); console.log(Buffer.concat([c.update("hello world", 'utf8'), c.final()]).toString('base64'));
printf '%s' 'hello world' | openssl enc -camellia-192-ecb -K 6d7920736563726574000000000000000000000000000000 -a -A
printf instead of echo: echo adds a line break, which changes the result. -K and -iv take hex; with -k or -pass, openssl derives a different key from a password.
Why your camellia-192-ecb result doesn't match
Many tutorials turn a password into a key with SHA-256 or MD5. This tool doesn't: it uses the bytes of your secret directly and pads them with zero bytes. Copy the key in hex from What the tool did and use it as the raw key.
The tool shows the raw ciphertext bytes as Base64. Many libraries return hex or raw bytes. Convert before comparing, or compare with the hex blocks in What the tool did.
The tool pads with PKCS#7 (OpenSSL's default). Some libraries pad with zeros or not at all. A text of exactly one block still gets a full block of padding (10 10 … 10 for 16-byte blocks).
With a zero IV, the first CBC block is exactly the ECB block, because XOR with zeros changes nothing. Texts up to one block long (15 bytes plus padding) give the same result in CBC and ECB. From the second block on they differ, see the family comparison.
Like the old site, the tool trims spaces and line breaks at the start and end of the text and the secret, and sends line breaks as CRLF (\r\n), as a browser form does. echo "text" | in a shell adds a line break at the end.
Only the first bytes up to the key length count, the rest is cut off. Two secrets that start with the same bytes give the same result. Non-ASCII characters take 2–4 bytes in UTF-8, so they fill the key faster.
Given a password, the openssl command line derives key and IV from it with a random salt (EVP_BytesToKey or PBKDF2), and the output starts with U2FsdGVkX1 ("Salted__"). That is a different format. Pass the key and IV in hex with -K and -iv instead, as in the code example.
Encrypted something here years ago?
Paste the Base64 result and the secret. Your browser tries all 174 ciphers of this site and shows those that give readable text. Useful if you don't remember the cipher, or to check whether your ciphertext really is camellia-192-ecb.
Every Camellia-192 variant, same input
The text The quick brown fox jumps over the lazy dog (43 bytes) with the secret my secret in all 8 Camellia-192 ciphers. The last column lists names that give the same result: aliases, and modes that agree for this input. Highlighted: the same start as camellia-192-ecb. Watch how CBC and ECB share the first block, and CFB, OFB and CTR the first 16 bytes. Type a text and a secret in the tool above to use yours.
| Cipher | Result (Base64) | Same as |
|---|---|---|
| camellia-192-cbc | Luehqx6/SJ5jjmhCFoFHfXWXXW4VqKy+2qhq05/k9QErDyq1raIb/7pRy1fp7cSI | camellia192 |
| camellia-192-cfb | pleter3vFS+Qv2D4D0ddiBgT5eYjrMrP3TqHcytAJRFmDeR5EoSVuzyVOg== | |
| camellia-192-cfb1 | 52trx0BMCmE2ci8/RHNM+dXYdyJIhjEhe/jf6o5xiMpN44e61/1WhiskpQ== | |
| camellia-192-cfb8 | pjCaYKtz/WNAKAlLvRo3eSnUNwkuuuAdjiIS9mWSKAbjG+sVNlAvxlBy3w== | |
| camellia-192-ctr | pleter3vFS+Qv2D4D0ddiGkfjNMkHZrlUSrjUHYLuth4bc96zoI3sFvtdA== | |
| camellia-192-ecb Legacy | Luehqx6/SJ5jjmhCFoFHfZaU7gqU6LTCvXVkl7CuSONl+xQn2IkEdPkYFFiHicCl | |
| camellia-192-ofb | pleter3vFS+Qv2D4D0ddiDOSv8BAdhH03pucTdJfEJB+2pure8U9MxfFKQ== | |
| camellia192 | Luehqx6/SJ5jjmhCFoFHfXWXXW4VqKy+2qhq05/k9QErDyq1raIb/7pRy1fp7cSI | camellia-192-cbc |
camellia-192-ecb test values
Results for common test strings with the secret my secret (UTF-8, no line break, zero IV), exactly as the tool and PHP's openssl_encrypt give them. Use them to check your own implementation.
| Text | camellia-192-ecb (Base64) |
|---|---|
| empty string | BFZQdpUNyy6bSIvrspf+VA== |
a | xl7kpcOlaunYcYW9ITIFQQ== |
hello world | 2Pyf1WQgMK6Sq0l1GHN3GQ== |
0123456789abcdef | oJ6KHOmo7fbYFVrwhUM7cARWUHaVDcsum0iL67KX/lQ= |
The quick brown fox jumps over the lazy dog | Luehqx6/SJ5jjmhCFoFHfZaU7gqU6LTCvXVkl7CuSONl+xQn2IkEdPkYFFiHicCl |
Questions about camellia-192-ecb
Can camellia-192-ecb be decrypted without the secret?
No. Without the secret there is no shortcut. A short or common secret can be guessed, though, because the tool uses it directly as the key.
Why does my camellia-192-ecb code give a different result?
Almost always because of the key or the IV: the tool pads your secret with zero bytes instead of hashing it and uses a zero IV. Also check Base64 vs hex, padding, and spaces or line breaks the tool trims.
Is camellia-192-ecb safe to use?
Not for real data. ECB encrypts equal blocks to equal output, so patterns in the data stay visible. Use it only to match an existing system.
Is Camellia secure?
Camellia has no practical attack. The weak points of this tool are the setup (zero IV, secret as key, no authentication), not the cipher.
How long should my secret be?
Exactly 24 bytes (192 bits) fills the key; anything after that is ignored. For real security a random key is better than a typed word.