This PR adds the Vigenère cipher operation to the @ciphereditor/extension-essentials. The code is based on the Caesar cipher and cryptii code for the Vigenère cipher.
Four different variants of the cipher are available, just like Cryptii.
Traditional Vigenère cipher: inputIndex + alphabetIndex,
Trithemius cipher: Vigenere with fixed key and key mode.
The code gives an error when the key is empty or contains characters not in the alphabet. If none of the plain-/ciphertext characters are from the alphabet, it warns the user to avoid confusion.
The Trithemius cipher uses a fixed key and key mode. Currently, this is not communicated to the user, this can be part of an upcoming update.
The images below show the difference between key mode “repeat” → `keykey` and “auto-key” → `keymessage`, the cipher variants and the errors & warning.
(The first and third image were created before the variants were implemented, hence they lack that control.)
I did my best attempt at writing a description for the operation, but I'm unsure if it is easily understandable in its current form.
This PR adds the Vigenère cipher operation to the
@ciphereditor/extension-essentials
. The code is based on the Caesar cipher and cryptii code for the Vigenère cipher.Four different variants of the cipher are available, just like Cryptii.
inputIndex
+alphabetIndex
,alphabetIndex
-inputIndex
,inputIndex
-alphabetIndex
,The code gives an error when the key is empty or contains characters not in the alphabet. If none of the plain-/ciphertext characters are from the alphabet, it warns the user to avoid confusion.
The Trithemius cipher uses a fixed key and key mode. Currently, this is not communicated to the user, this can be part of an upcoming update.
The images below show the difference between key mode “repeat” → `keykey` and “auto-key” → `keymessage`, the cipher variants and the errors & warning.
(The first and third image were created before the variants were implemented, hence they lack that control.)I did my best attempt at writing a description for the operation, but I'm unsure if it is easily understandable in its current form.
PS: It was fun to do this, the system feels nice and is self-documenting for the most part. The most obvious place where something could be simplified with less code duplication is already addressed in the backlog as well: https://github.com/wierkstudio/ciphereditor/blob/c722c049cf8ebfcf9b4ffdbe71577135508f459a/packages/app-web/src/slices/directory/index.ts#L6-L7