One-time pad encoder/decoder and key generator

Settings Remark
Message / cipher If conversion method "Encrypt" is selected, enter a message in the input box.
You can enter any language, e.g.: English, Chinese, Russian etc.
All texts are considered UTF-8 encoded.
UTF-8 is a multibyte encoding that can represent any Unicode character in 1 to 4 bytes.
  • ASCII characters (U+0000 to U+007F) take 1 byte
  • Code points U+0080 to U+07FF take 2 bytes
  • Code points U+0800 to U+FFFF take 3 bytes
  • Code points U+10000 to U+10FFFF take 4 bytes
The Chinese character for "dragon" is
The Unicode for this character is: U+9F99 and will take up 3 bytes.

The English word "dragon" consists of 6 ASCII characters, thus total 6 bytes.

Each character in a message will be converted into a hexadecimal value:
The Chinese character for "dragon": e9be99 (hex)
The English word "dragon": 647261676f6e (hex)

To encrypt the word "dragon" you need two one-time pads. A one-time pad to encrypt/decrypt the Chines word "dragon", for example: 402129 and a one-time pad to encrypt/decrypt the English word "dragon", for example: 07ba6eeedbdc

Encrypt Chinese character for "dragon":
message:      e9be99
one-time pad: 402129 
              ------- xor
cipher:       a99fb0

Encrypt English word "dragon":
message:      647261676f6e
one-time pad: 07ba6eeedbdc
              ------------- xor
cipher:       63c80f89b4b2		
Each time a message is encrypted always use a different one-time pad.

If conversion method "Decrypt" is selected, enter a cipher text in the input box.
The cipher text must be hexadecimal value and may contain a prefix followed by a colon, for example:


The one-time pad must be hexadecimal value and may contain a prefix followed by a colon, for example:


In this example, the prefix "020" in the cipher text helps the recipient which one-time pad should be used to decrypt the the cipher text. The recipient may have a large list of one-time pads, for example:


You can omit the prefix and colon in the cipher text and/or one-time pad (both are not used for actual decoding) as long as the recipient of the cipher text knows which one-time pad must be used to decode the cipher.

Decrypt a cipher text:
cipher:       3184e64dddfa25059c557d
one-time pad: 79e18a21b2da726aee3919
              ---------------------- xor
message:      48656c6c6f20576f726c64	

message in UTF-8: Hello World