Can you decipher the word LNEI?

Encryption

 

On this page you can encrypt or decrypt texts between the two windows.
A quick guide and further information can be found after the form fields.

DANGER! Old version. Only intended for decrypting texts that were also encrypted with this.
Better use the current script for the new encryption!

quick start Guide

To encode a text, write or copy it into the upper field "Plain text", enter the keyword in the field provided and click on the "Encode" button.
The encrypted text then appears as a sequence of characters in the "Code" field below.
The input fields "Plain text" and "Keyword" are deleted.

To decrypt a text encrypted in this way, copy the coded message (e.g. from an e-mail) into the code field, enter the keyword that was used for encryption in the field provided and click on "Decode" .
The plain text appears in the "Plain text" field.
The "Code" and "Keyword" input fields are deleted.
ATTENTION: If you use the wrong keyword, the plaintext will remain encrypted; However, you can restore the original code by re-encrypting the illegible "plain text" with the same wrong code.

After coding, the insertion point is in the field for entering an email address. If the code is not too long, you can send it directly from the form. Otherwise (in the event of an error message) you have to transfer it manually to an email program by copying it to the clipboard.

background knowledge

The encryption is symmetrical, i.e. the sender and recipient must have the same keyword.
The encryption algorithm is based on the Vigenère square, in which each new letter of the keyword determines the alphabet from which the code character is taken from the same place as the plaintext character in the normal alphabet. (This is why it is also called polyalphabetic encryption.)

Vigenère encryption is NOT a secure method! You can increase the level of difficulty for potential code breakers by making the ratio of keyword to message length as large as possible; ideally, the key is as long as the message. In addition, the key should, if possible, consist of a random sequence of characters so that parts of the key cannot identify the rest of the key.

Here is another version of this program that uses the XOR link for encryption.

Focus control

The Javascript program contains a control of the input focus:
When the page is called up, the cursor is positioned in the plain text field ('onload' in the body tag).
If you leave this field with the mouse or the Tab key, the insertion point will automatically move into the keyword field if you have entered plain text; if not, the cursor is in the code field.
The same applies to the code field.
When you exit the keyword field, the correct button is automatically selected, depending on whether you have entered plain text or a code in addition to the key.
Only when one of the two buttons has the focus can you freely use the mouse again, e.g. to mark text or to follow the links in this help text.

particularities

Apparently there is a limit to the text length that an html form can transfer to an email program with the help of "mailto:" and "body" parameters. In any case, the attempt to send the code directly from the form generates an error message if it exceeds a certain number of characters.

When a code is sent by email, it is possible that line breaks are added on the way to the recipient. From the first character added to the original code, the message can no longer be decrypted.
Therefore, the decryption algorithm first removes all line breaks (CR and LF characters) from the code entered. (An original code CANNOT contain such line breaks because they are not part of the cipher alphabet.)

Special features of Internet Explorer

The Internet Explorer interprets all combinations of ASCII codes 10 and 13 (10 = line feed, LF, line feed; 13 = carriage return, CR, carriage return) as a complete line break with the two characters CR and LF:

CR + LF → CR + LF
LF + CR → CR + LF
LF → CR + LF
CR → CR + LF

Since the program converts all code characters individually into letters, and a change in the number of characters leads to problems, the encryption program is programmed in such a way that it "masks" line breaks with another character, i.e. replaces them with them. This character is in the variable new line and can be changed - but then at the sender AND at the receiver!
To ensure unambiguous decryption, this masking character should not appear in plain text. If this is the case, the program offers the option of replacing the character in plain text with another.

Using the program

You can of course use this website and thus the program freely.
Take a look at the source code if you are interested in programming; the scripts are commented.

I do not take any responsibility for the correctness of the encryption and decryption or any other correctness of the program.
It is a very simple encryption algorithm, the protection of which does not correspond to the state of the art of asynchronous encryption.


To ensure a minimum level of security, use long, randomly composed keywords and exchange them on a secure channel between sender and receiver.

To be sure that you have typed the keyword correctly, you can enter the keyword again after coding and decode the code you just generated.
Make a copy of the generated code beforehand so that you can use it this way if it is likely to succeed.

I would be delighted if you could send me your thoughts on this program.





If this page is displayed without a navigation bar, activate Javascript or click here!