0
0

ChaCha20 Encryption

Egor VolchenkoEgor Volchenko
CreatedDec 3, 2026
UpdatedDec 3, 2026

This ChaCha20 encryption tool encrypts pasted text or encoded bytes using a raw key and displays a complete payload as Hex or Base64. This plain stream-cipher operation does not authenticate the message. The IV / Nonce field is shared UI; the operation generates its own prefix rather than using that field.

1
Output Format:
1

How to use ChaCha20 Encryption

Use the following steps to process a small test input.

Encrypt a ChaCha20 test message

  1. Paste the message into Plaintext. Set Input Encoding: to UTF-8 for normal text or the representation of source bytes.
  2. Enter the same 32-byte UTF-8 key in Encryption Key / Password. This form has no separate key-encoding or password-derivation selector.
  3. Select Hex (lower), Hex (UPPER), or Base64. Leave IV / Nonce (Optional / Auto-generated) blank: its typed value is ignored. The operation generates and embeds its own prefix.
  4. Leave Auto / Live on for updates, or turn it off and click Encrypt.
  5. Read Encrypted Ciphertext (Base64). Keep the complete encoded value, including its prefix.
  6. Click Copy to copy the result. Use Clear where shown, or the field clear controls, to remove the text.

For UTF-8 plaintext hello and key 0123456789abcdef0123456789abcdef, one verified Hex payload is 812100192a74c032ee458b8d145eb3c68f55cd85b2. A new run normally produces different bytes because the prefix is generated again. The matching decryption operation restores hello. This key is public test data.

A rejected request may leave an earlier result visible. Clear the fields and recheck the input before relying on a new calculation.

Match the payload layout

This operation expects a 16-byte initial-state prefix followed by ciphertext. This is the OpenSSL-style ChaCha20 layout with a 16-byte initial state, not a bare IETF 12-byte-nonce packet. No XChaCha20 or initial-counter setting is exposed.

Treat the key as bytes

Encryption Key / Password is interpreted as UTF-8 text, even if it looks like Hex or Base64. Internally, shorter keys are zero-padded and longer keys are truncated to 32 bytes; this does not provide password stretching. Use an exact 32-byte test key when comparing results. The fixed output label can still say Base64 when Hex is selected.

Frequently asked questions

The visible IV / Nonce (Optional / Auto-generated) field is ignored by this operation. Encryption generates the prefix; decryption reads it from the payload.

API — ChaCha20 Payload Encryptor

Automate this tool directly from your scripts, CI/CD pipelines, or backend applications via HTTP POST.

No API Key Required 60 req/min
https://million.tools/api/v1/run/chacha20-encrypt

Request Parameters (JSON / Form Data)

  • input_encoding

    Input Encoding

    hex hex_ignore_non_hex base64 utf-8 utf-16le utf-16be windows-1251 windows-1252
    Type: string Default: utf-8
  • start (or input)

    Plaintext

    Type: string Default: —
  • hmac_key

    Encryption Key / Password

    Type: string Default: —
  • cipher_iv

    IV / Nonce (Optional / Auto-generated)

    Type: string Default: —
  • output_format

    Output encoding format

    hex hex_upper base64
    Type: string Default: hex
bash — cURL
curl -X POST https://million.tools/api/v1/run/chacha20-encrypt \
  -H "Content-Type: application/json" \
  -d '{"start":"Hello, million.tools!","hmac_key":"0123456789abcdef0123456789abcdef","output_format":"base64"}'
const response = await fetch('https://million.tools/api/v1/run/chacha20-encrypt', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "start": "Hello, million.tools!",
      "hmac_key": "0123456789abcdef0123456789abcdef",
      "output_format": "base64"
  }),
});

const data = await response.json();
console.log(data.result);
import requests

response = requests.post(
    'https://million.tools/api/v1/run/chacha20-encrypt',
    json={
        "start": "Hello, million.tools!",
        "hmac_key": "0123456789abcdef0123456789abcdef",
        "output_format": "base64",
    },
    timeout=15,
)

data = response.json()
print(data['result'])
$ch = curl_init('https://million.tools/api/v1/run/chacha20-encrypt');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'start' => 'Hello, million.tools!',
        'hmac_key' => '0123456789abcdef0123456789abcdef',
        'output_format' => 'base64',
    ]),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo $response['result'] ?? '';
{
    "status": "success",
    "tool": "chacha20-encrypt",
    "service": "chacha20_encrypt",
    "result": "Mg8vNa/STd0gxYkmhzApcH4MTj/ZGub0maKgfHomV1Cml7Wbbg==",
    "results": {
        "result": "Mg8vNa/STd0gxYkmhzApcH4MTj/ZGub0maKgfHomV1Cml7Wbbg=="
    }
}
Egor Volchenko
Egor Volchenko Developer & Author

Hi! I’m a WordPress developer with over 10 years of experience. I love Tailwind CSS, clean code, and intuitive interfaces. I’m currently working on million.tools — a service with convenient online tools for everyday tasks. I’m building it from scratch with great attention to detail and user experience.

Published:
Updated:

Ratings & feedback 0

Share your experience with this tool.

Leave feedback

Your rating (optional)

Select a rating

Write a review, leave a rating, or do both.

Your email stays private.

No feedback yet

Be the first to leave a review or rating.