From d7c37316139355f1f745ff11b99f0be3fe7192ea Mon Sep 17 00:00:00 2001 From: JAHNAB DUTTA Date: Sat, 25 Mar 2023 20:15:46 +0530 Subject: [PATCH 1/6] added vignere cipher explanation --- en/Ciphers/vignere_cipher.md | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 en/Ciphers/vignere_cipher.md diff --git a/en/Ciphers/vignere_cipher.md b/en/Ciphers/vignere_cipher.md new file mode 100644 index 00000000..98090d91 --- /dev/null +++ b/en/Ciphers/vignere_cipher.md @@ -0,0 +1,78 @@ +# Vignere Cipher + +Vignere Cipher is a famous toy cipher. The cipher was invented in 1553 by the Italian cryptographer Giovan Battista Bellaso but for centuries was attributed to the 16th-century French cryptographer Blaise de Vigenère, who devised a similar cipher in 1586. + +It is easy to encrypt and decrypt but at the same time, it is easy to intercept and crack this cipher. It is a polyalphabetic substitution cipher, meaning that the same letter of the alphabet can be replaced by different letters depending on the key. The key is a word or a phrase that is repeated to match the length of the message. Then the letters of the key are used to shift the letters of the message. + +## Setup +1. Choose the message space you are going to use. In our case, we will use all lowercase letters of English language. But we can use ASCII characters as well. Let us denote the size of the message space as `n`. In our case, `n=26`. +2. Assign a numerial value to each letter of the message space. For example, a=1, b=2, c=3 and so on. +3. Choose a key. + +## Encryption +1. Repeat the key to match the length of the message. For example, if the message is "checktheking" and the key is "chess", the key is repeated to match the length of the message. The key is now "chesschessch". + +2. Now, the letters of the key are used to shift the letters of the message. Let a be 1, b be 2 and so on. Then, the message is encrypted using the following formula: + + `Cipher[i] = (Value[Message[i]] + Value[Key[i]]) % n` + + where `Cipher[i]` is the encrypted letter at position `i`, `Value[Message[i]]` is the numerical value of the letter at position `i` in the message, `Value[Key[i]]` is the numerical value of the letter at position `i` in the key and `n` is the size of the message space. + And `%` is the modulo operator. + + +| message | c | h | e | c | k | t | h | e | k | i | n | g | +|---------|---|---|---|---|---|---|---|---|---|---|---|---| +| value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | +| Key | c | h | e | s | s | c | h | e | s | s | c | h | +| Shift | 3 | 8 | 5 | 19| 19| 3 | 8 | 5 | 19| 19| 3 | 8 | +| Cipher | f | p | j | q | z | w | p | j | z | z | c | p | + +So the encrypted message is "fpjqzwjpzzcp". + +## Decryption +1. Decryption is the reverse of encryption. The decryption is done by subtracting the shift value from the cipher value. The decryption of the above example is: + + `Message[i] = (Cipher[i] - Value[Key[i]]) % n` + + where `Message[i]` is the decrypted letter at position `i`, `Cipher[i]` is the encrypted letter at position `i`, `Value[Key[i]]` is the numerical value of the letter at position `i` in the key and `n` is the size of the message space. + And `%` is the modulo operator. + +| Cipher | f | p | j | q | z | w | p | j | z | z | c | p | +|---------|---|---|---|---|---|---|---|---|---|---|---|---| +| Key | c | h | e | s | s | c | h | e | s | s | c | h | +| Shift | 3 | 8 | 5 | 19| 19| 3 | 8 | 5 | 19| 19| 3 | 8 | +| Value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | +| Message | c | h | e | c | k | t | h | e | k | i | n | g | + +So the decrypted message is "checktheking". + + +## Complexity Analysis + +### Encryption + +The encryption is done by adding the shift value to the message value. So the time complexity is `O(n)` where `n` is the length of the message. We use a linear data structure such as an array to store the message and the key. So the space complexity is `O(n)`. + +1. Time Complexity: `O(n)` +2. Space Complexity: `O(n)` + +### Decryption + +Decryption is similar to encryption except for the subtraction operation. So time and space complexity is the same as encryption. + +1. Time Complexity: `O(n)` +2. Space Complexity: `O(n)` + +## Cryptanalysis and caution + +1. It is a toy cipher. It is easy to crack. It is not secure. +2. There are several key finding methods such as + - [Kasiski examination](https://en.wikipedia.org/wiki/Kasiski_examination) + - [Index of coincidence](https://en.wikipedia.org/wiki/Index_of_coincidence) +3. Once key is found, we can use [frequency analysis](https://en.wikipedia.org/wiki/Frequency_analysis) to crack the cipher. +4. Therfore, this cipher should not be used to encrypt any important data. + +## Implementation +- [C++](https://github.com/TheAlgorithms/Python/blob/master/ciphers/vigenere_cipher.py) +- [Python](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/ciphers/vigenere_cipher.cpp) +- [Javascript](https://github.com/TheAlgorithms/JavaScript/blob/master/Ciphers/VigenereCipher.js) From 902c84e2c9e66574927d2f751816af319ca7e831 Mon Sep 17 00:00:00 2001 From: JAHNAB DUTTA Date: Sat, 25 Mar 2023 22:39:10 +0530 Subject: [PATCH 2/6] added relation to ceaser cipher and fixed typos --- .../{vignere_cipher.md => vigenere_cipher.md} | 48 ++++++++++++++++--- 1 file changed, 41 insertions(+), 7 deletions(-) rename en/Ciphers/{vignere_cipher.md => vigenere_cipher.md} (75%) diff --git a/en/Ciphers/vignere_cipher.md b/en/Ciphers/vigenere_cipher.md similarity index 75% rename from en/Ciphers/vignere_cipher.md rename to en/Ciphers/vigenere_cipher.md index 98090d91..da9b67b5 100644 --- a/en/Ciphers/vignere_cipher.md +++ b/en/Ciphers/vigenere_cipher.md @@ -1,25 +1,38 @@ -# Vignere Cipher +# Vigenere Cipher + + +Vigenere cipher is a famous toy cipher. The cipher was invented in 1553 by the Italian cryptographer Giovan Battista Bellaso but for centuries was attributed to the 16th-century French cryptographer Blaise de Vigenère, who devised a similar cipher in 1586. -Vignere Cipher is a famous toy cipher. The cipher was invented in 1553 by the Italian cryptographer Giovan Battista Bellaso but for centuries was attributed to the 16th-century French cryptographer Blaise de Vigenère, who devised a similar cipher in 1586. It is easy to encrypt and decrypt but at the same time, it is easy to intercept and crack this cipher. It is a polyalphabetic substitution cipher, meaning that the same letter of the alphabet can be replaced by different letters depending on the key. The key is a word or a phrase that is repeated to match the length of the message. Then the letters of the key are used to shift the letters of the message. + +## Improvement over Ceasar cipher +The vigenere cipher is an improvement over the ceasar cipher. In ceaser cipher we use a single character as the key to shift the message. But in vigenere cipher, we use a word or a phrase as the key. This means that the same character occurring at different positions in the message will be shifted by different amounts. This makes it harder to crack the cipher. + + ## Setup -1. Choose the message space you are going to use. In our case, we will use all lowercase letters of English language. But we can use ASCII characters as well. Let us denote the size of the message space as `n`. In our case, `n=26`. -2. Assign a numerial value to each letter of the message space. For example, a=1, b=2, c=3 and so on. -3. Choose a key. +1. Choose the message space you are going to use. In our case, we will use all lowercase letters of the English language. But we can use ASCII characters as well. Let us denote the size of the message space as `n`. In our case, `n=26`. +2. Assign a numerical value to each letter of the message space. For example, a=1, b=2, c=3 and so on. +3. Choose a key. + ## Encryption 1. Repeat the key to match the length of the message. For example, if the message is "checktheking" and the key is "chess", the key is repeated to match the length of the message. The key is now "chesschessch". + 2. Now, the letters of the key are used to shift the letters of the message. Let a be 1, b be 2 and so on. Then, the message is encrypted using the following formula: + `Cipher[i] = (Value[Message[i]] + Value[Key[i]]) % n` + where `Cipher[i]` is the encrypted letter at position `i`, `Value[Message[i]]` is the numerical value of the letter at position `i` in the message, `Value[Key[i]]` is the numerical value of the letter at position `i` in the key and `n` is the size of the message space. And `%` is the modulo operator. + + | message | c | h | e | c | k | t | h | e | k | i | n | g | |---------|---|---|---|---|---|---|---|---|---|---|---|---| | value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | @@ -27,16 +40,21 @@ It is easy to encrypt and decrypt but at the same time, it is easy to intercept | Shift | 3 | 8 | 5 | 19| 19| 3 | 8 | 5 | 19| 19| 3 | 8 | | Cipher | f | p | j | q | z | w | p | j | z | z | c | p | + So the encrypted message is "fpjqzwjpzzcp". + ## Decryption 1. Decryption is the reverse of encryption. The decryption is done by subtracting the shift value from the cipher value. The decryption of the above example is: + `Message[i] = (Cipher[i] - Value[Key[i]]) % n` + where `Message[i]` is the decrypted letter at position `i`, `Cipher[i]` is the encrypted letter at position `i`, `Value[Key[i]]` is the numerical value of the letter at position `i` in the key and `n` is the size of the message space. And `%` is the modulo operator. + | Cipher | f | p | j | q | z | w | p | j | z | z | c | p | |---------|---|---|---|---|---|---|---|---|---|---|---|---| | Key | c | h | e | s | s | c | h | e | s | s | c | h | @@ -44,35 +62,51 @@ So the encrypted message is "fpjqzwjpzzcp". | Value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | | Message | c | h | e | c | k | t | h | e | k | i | n | g | + So the decrypted message is "checktheking". + + ## Complexity Analysis + ### Encryption + The encryption is done by adding the shift value to the message value. So the time complexity is `O(n)` where `n` is the length of the message. We use a linear data structure such as an array to store the message and the key. So the space complexity is `O(n)`. + 1. Time Complexity: `O(n)` 2. Space Complexity: `O(n)` + ### Decryption + Decryption is similar to encryption except for the subtraction operation. So time and space complexity is the same as encryption. + 1. Time Complexity: `O(n)` 2. Space Complexity: `O(n)` + ## Cryptanalysis and caution + 1. It is a toy cipher. It is easy to crack. It is not secure. 2. There are several key finding methods such as - [Kasiski examination](https://en.wikipedia.org/wiki/Kasiski_examination) - [Index of coincidence](https://en.wikipedia.org/wiki/Index_of_coincidence) -3. Once key is found, we can use [frequency analysis](https://en.wikipedia.org/wiki/Frequency_analysis) to crack the cipher. -4. Therfore, this cipher should not be used to encrypt any important data. +3. Once key length is found, we can use [frequency analysis](https://en.wikipedia.org/wiki/Frequency_analysis) to find the key and hence crack the cipher. +4. Therefore, this cipher should not be used to encrypt any important data. + ## Implementation - [C++](https://github.com/TheAlgorithms/Python/blob/master/ciphers/vigenere_cipher.py) - [Python](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/ciphers/vigenere_cipher.cpp) - [Javascript](https://github.com/TheAlgorithms/JavaScript/blob/master/Ciphers/VigenereCipher.js) + + + + From 8422cc5b5ada70089604fbadd6b06c83e7b35260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:48:43 +0100 Subject: [PATCH 3/6] Fix some typos, improve formatting & wording a bit --- en/Ciphers/vigenere_cipher.md | 87 +++++++++-------------------------- 1 file changed, 22 insertions(+), 65 deletions(-) diff --git a/en/Ciphers/vigenere_cipher.md b/en/Ciphers/vigenere_cipher.md index da9b67b5..461bf7ba 100644 --- a/en/Ciphers/vigenere_cipher.md +++ b/en/Ciphers/vigenere_cipher.md @@ -1,59 +1,36 @@ # Vigenere Cipher - -Vigenere cipher is a famous toy cipher. The cipher was invented in 1553 by the Italian cryptographer Giovan Battista Bellaso but for centuries was attributed to the 16th-century French cryptographer Blaise de Vigenère, who devised a similar cipher in 1586. - +The Vigenere cipher is a famous toy cipher. It was invented in 1553 by the Italian cryptographer Giovan Battista Bellaso but for centuries was attributed to the 16th-century French cryptographer Blaise de Vigenère, who devised a similar cipher in 1586. It is easy to encrypt and decrypt but at the same time, it is easy to intercept and crack this cipher. It is a polyalphabetic substitution cipher, meaning that the same letter of the alphabet can be replaced by different letters depending on the key. The key is a word or a phrase that is repeated to match the length of the message. Then the letters of the key are used to shift the letters of the message. +## Improvement over Caesar cipher -## Improvement over Ceasar cipher -The vigenere cipher is an improvement over the ceasar cipher. In ceaser cipher we use a single character as the key to shift the message. But in vigenere cipher, we use a word or a phrase as the key. This means that the same character occurring at different positions in the message will be shifted by different amounts. This makes it harder to crack the cipher. - +The Vigenere cipher is an improvement over the Caesar cipher. The Caesar cipher uses a single character as the key to shift the message. In contrast, the Vigenere cipher uses a word or a phrase as the key. This means that the same character occurring at different positions in the message will be shifted by different amounts. This makes it harder to crack the cipher. ## Setup -1. Choose the message space you are going to use. In our case, we will use all lowercase letters of the English language. But we can use ASCII characters as well. Let us denote the size of the message space as `n`. In our case, `n=26`. -2. Assign a numerical value to each letter of the message space. For example, a=1, b=2, c=3 and so on. -3. Choose a key. +1. Choose the message space you are going to use. In our case, we will use all lowercase letters of the English language. But we can use ASCII characters as well. Let us denote the size of the message space as $n$. In our case, $n = 26$. +2. Assign a numerical value to each letter of the message space. For example, $a=1, b=2, c=3$ and so on. +3. Choose a key. ## Encryption -1. Repeat the key to match the length of the message. For example, if the message is "checktheking" and the key is "chess", the key is repeated to match the length of the message. The key is now "chesschessch". - - -2. Now, the letters of the key are used to shift the letters of the message. Let a be 1, b be 2 and so on. Then, the message is encrypted using the following formula: - - - `Cipher[i] = (Value[Message[i]] + Value[Key[i]]) % n` - - where `Cipher[i]` is the encrypted letter at position `i`, `Value[Message[i]]` is the numerical value of the letter at position `i` in the message, `Value[Key[i]]` is the numerical value of the letter at position `i` in the key and `n` is the size of the message space. - And `%` is the modulo operator. +1. Repeat the key to match the length of the message. For example, if the message is `checktheking` and the key is `chess`, the key is repeated to match the length of the message. The key is now `chesschessch`. +2. Now, the letters of the key are used to shift the letters of the message. Let $a$ be $1$, $b$ be $2$ and so on. Then, the message is encrypted using the following formula: $C_i = (V(M_i) + V(K_i)) \mod n$ where $C_i$ is the encrypted letter at position $i$, $V(M_i)$ is the numerical value of the letter at position $i$ and $V(K_i)$ is the numerical value of the letter at position $i$, and $n$ is the size of the message space. - - - -| message | c | h | e | c | k | t | h | e | k | i | n | g | +| Message | c | h | e | c | k | t | h | e | k | i | n | g | |---------|---|---|---|---|---|---|---|---|---|---|---|---| -| value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | +| Value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | | Key | c | h | e | s | s | c | h | e | s | s | c | h | | Shift | 3 | 8 | 5 | 19| 19| 3 | 8 | 5 | 19| 19| 3 | 8 | | Cipher | f | p | j | q | z | w | p | j | z | z | c | p | - -So the encrypted message is "fpjqzwjpzzcp". - +So the encrypted message is `fpjqzwjpzzcp`. ## Decryption -1. Decryption is the reverse of encryption. The decryption is done by subtracting the shift value from the cipher value. The decryption of the above example is: - - - `Message[i] = (Cipher[i] - Value[Key[i]]) % n` - - - where `Message[i]` is the decrypted letter at position `i`, `Cipher[i]` is the encrypted letter at position `i`, `Value[Key[i]]` is the numerical value of the letter at position `i` in the key and `n` is the size of the message space. - And `%` is the modulo operator. +Decryption is the inverse of encryption. It is is done by subtracting the shift value from the cipher value. The formula is $M_i = L(C_i - V(K_i))$ where everything is defined as above and $L$ is additionally defined as a function which converts a numerical value back to a letter. | Cipher | f | p | j | q | z | w | p | j | z | z | c | p | |---------|---|---|---|---|---|---|---|---|---|---|---|---| @@ -62,51 +39,31 @@ So the encrypted message is "fpjqzwjpzzcp". | Value | 3 | 8 | 5 | 3 | 11| 20| 8 | 5 | 11| 9 | 14| 7 | | Message | c | h | e | c | k | t | h | e | k | i | n | g | - -So the decrypted message is "checktheking". - - - +So the decrypted message is `checktheking`, as expected. ## Complexity Analysis - ### Encryption - -The encryption is done by adding the shift value to the message value. So the time complexity is `O(n)` where `n` is the length of the message. We use a linear data structure such as an array to store the message and the key. So the space complexity is `O(n)`. - - -1. Time Complexity: `O(n)` -2. Space Complexity: `O(n)` - +The encryption is done by adding the shift value to the message value. So the **time complexity is $O(n)$** where $n$ is the length of the message. +We use a linear data structure such as an array to store the message and the key. So the **space complexity is $O(n)$**. ### Decryption - -Decryption is similar to encryption except for the subtraction operation. So time and space complexity is the same as encryption. - - -1. Time Complexity: `O(n)` -2. Space Complexity: `O(n)` - +Decryption is similar to encryption (except for the subtraction operation). +**So time and space complexity are the same as for encryption - $O(n)$**. ## Cryptanalysis and caution - -1. It is a toy cipher. It is easy to crack. It is not secure. -2. There are several key finding methods such as +1. **It is a toy cipher. It is easy to crack. It is not secure.** +2. There are several key (length) finding methods such as - [Kasiski examination](https://en.wikipedia.org/wiki/Kasiski_examination) - [Index of coincidence](https://en.wikipedia.org/wiki/Index_of_coincidence) -3. Once key length is found, we can use [frequency analysis](https://en.wikipedia.org/wiki/Frequency_analysis) to find the key and hence crack the cipher. +3. Once the key length is found, [frequency analysis](https://en.wikipedia.org/wiki/Frequency_analysis) can be used to find the key and hence crack the cipher. 4. Therefore, this cipher should not be used to encrypt any important data. +## Implementations -## Implementation - [C++](https://github.com/TheAlgorithms/Python/blob/master/ciphers/vigenere_cipher.py) - [Python](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/ciphers/vigenere_cipher.cpp) -- [Javascript](https://github.com/TheAlgorithms/JavaScript/blob/master/Ciphers/VigenereCipher.js) - - - - +- [JavaScript](https://github.com/TheAlgorithms/JavaScript/blob/master/Ciphers/VigenereCipher.js) From 943dc8d8eb19d714bf5b89ad51e1217e97e72447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:50:08 +0100 Subject: [PATCH 4/6] Fix accidental loss of mod n --- en/Ciphers/vigenere_cipher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Ciphers/vigenere_cipher.md b/en/Ciphers/vigenere_cipher.md index 461bf7ba..d7f89160 100644 --- a/en/Ciphers/vigenere_cipher.md +++ b/en/Ciphers/vigenere_cipher.md @@ -30,7 +30,7 @@ So the encrypted message is `fpjqzwjpzzcp`. ## Decryption -Decryption is the inverse of encryption. It is is done by subtracting the shift value from the cipher value. The formula is $M_i = L(C_i - V(K_i))$ where everything is defined as above and $L$ is additionally defined as a function which converts a numerical value back to a letter. +Decryption is the inverse of encryption. It is is done by subtracting the shift value from the cipher value. The formula is $M_i = L((C_i - V(K_i)) \mod n)$ where everything is defined as above and $L$ is additionally defined as a function which converts a numerical value back to a letter. | Cipher | f | p | j | q | z | w | p | j | z | z | c | p | |---------|---|---|---|---|---|---|---|---|---|---|---|---| From f869cc12cf8b5045bb00afb535ec99df73f10bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Tue, 28 Mar 2023 08:55:26 +0200 Subject: [PATCH 5/6] Fix links Co-authored-by: David Leal --- en/Ciphers/vigenere_cipher.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/Ciphers/vigenere_cipher.md b/en/Ciphers/vigenere_cipher.md index d7f89160..c35b0401 100644 --- a/en/Ciphers/vigenere_cipher.md +++ b/en/Ciphers/vigenere_cipher.md @@ -64,6 +64,6 @@ Decryption is similar to encryption (except for the subtraction operation). ## Implementations -- [C++](https://github.com/TheAlgorithms/Python/blob/master/ciphers/vigenere_cipher.py) -- [Python](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/ciphers/vigenere_cipher.cpp) +- [C++](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/ciphers/vigenere_cipher.cpp) +- [Python](https://github.com/TheAlgorithms/Python/blob/master/ciphers/vigenere_cipher.py) - [JavaScript](https://github.com/TheAlgorithms/JavaScript/blob/master/Ciphers/VigenereCipher.js) From 95800e0dde635f1bf54f3784d0efbd76ee4cf543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Tue, 28 Mar 2023 08:55:48 +0200 Subject: [PATCH 6/6] Fix typo Co-authored-by: David Leal --- en/Ciphers/vigenere_cipher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/Ciphers/vigenere_cipher.md b/en/Ciphers/vigenere_cipher.md index c35b0401..04360074 100644 --- a/en/Ciphers/vigenere_cipher.md +++ b/en/Ciphers/vigenere_cipher.md @@ -2,7 +2,7 @@ The Vigenere cipher is a famous toy cipher. It was invented in 1553 by the Italian cryptographer Giovan Battista Bellaso but for centuries was attributed to the 16th-century French cryptographer Blaise de Vigenère, who devised a similar cipher in 1586. -It is easy to encrypt and decrypt but at the same time, it is easy to intercept and crack this cipher. It is a polyalphabetic substitution cipher, meaning that the same letter of the alphabet can be replaced by different letters depending on the key. The key is a word or a phrase that is repeated to match the length of the message. Then the letters of the key are used to shift the letters of the message. +It is easy to encrypt and decrypt but at the same time, it is easy to intercept and crack this cipher. It is a polyalphabetic substitution cipher, meaning that the same letter of the alphabet can be replaced by different letters depending on the key. The key is a word or phrase that is repeated to match the length of the message. Then the letters of the key are used to shift the letters of the message. ## Improvement over Caesar cipher