Vernam Cipher

Key

Vernam Cipher (also known as the one-time pad (OTP)) is an encryption technique that cannot be cracked, but requires the use of a one-time pre-shared key the same size as, or longer than, the message being sent.

How it works?

Suppose Alice wishes to send the message "HELLO" to Bob. Assume two pads of paper containing identical random sequences of letters were somehow previously produced and securely issued to both. Alice chooses the appropriate unused page from the pad.

The material on the selected sheet is the key for this message. Each letter from the pad will be combined in a predetermined way with one letter of the message. (It is common, but not required, to assign each letter a numerical value, e.g., "A" is 0, "B" is 1, and so on.)

Encryption

In this example, the technique is to combine the key and the message using modular addition. The numerical values of corresponding message and key letters are added together, modulo 26. So, if key material begins with "XMCKL" and the message is "HELLO", then the coding would be done as follows:

      H       E       L       L       O  message   7 (H)   4 (E)  11 (L)  11 (L)  14 (O) message+ 23 (X)  12 (M)   2 (C)  10 (K)  11 (L) key= 30      16      13      21      25     message + key=  4 (E)  16 (Q)  13 (N)  21 (V)  25 (Z) (message + key) mod 26      E       Q       N       V       Z  → ciphertext

If a number is larger than 26, then the remainder after subtraction of 26 is taken in modular arithmetic fashion. This simply means that if the computations "go past" Z, the sequence starts again at A.

Decryption

       E       Q       N       V       Z  ciphertext    4 (E)  16 (Q)  13 (N)  21 (V)  25 (Z) ciphertext-  23 (X)  12 (M)   2 (C)  10 (K)  11 (L) key= -19       4      11      11      14     ciphertext – key=   7 (H)   4 (E)  11 (L)  11 (L)  14 (O) ciphertext – key (mod 26)       H       E       L       L       O  → message

Similar to the above, if a number is negative then 26 is added to make the number zero or higher.


Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Hex Encode & Decode is a encode tool for free that can convert the text to hexadecimal bytes separated by the specified delimiter and also can convert hexadecimal byte string back into its raw value.

Hex Encode & Decode

Hex Encode & Decode is a encode tool for free that can convert the text to hexadecimal bytes separated by the specified delimiter and also can convert hexadecimal byte string back into its raw value.
GOST Block Cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits.

GOST Block Cipher

GOST Block Cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits.
SM4 is a 128-bit block cipher, currently established as a national standard (GB/T 32907-2016) of China. Multiple block cipher modes are supported. It complete implementation of SM4 cipher encryption/decryption with ECB, CBC, CFB, OFB, CTR block modes.

SM4 Cipher

SM4 is a 128-bit block cipher, currently established as a national standard (GB/T 32907-2016) of China. Multiple block cipher modes are supported. It complete implementation of SM4 cipher encryption/decryption with ECB, CBC, CFB, OFB, CTR block modes.
Random Password Generator can create random passwords of a specified length online. By setting whether the password includes lowercase letters (a-z), uppercase letters (A-Z), digits (0-9), and special characters, it can randomly generate passwords between 4 and 32 characters in length.

Random Password Generator

Random Password Generator can create random passwords of a specified length online. By setting whether the password includes lowercase letters (a-z), uppercase letters (A-Z), digits (0-9), and special characters, it can randomly generate passwords between 4 and 32 characters in length.