Given then plain text, the encrypted text and the keyword length I am called to find the cipher key using brute force attack. What I did was to take the six first characters from plain text and encrypted text and through the letter distances to compute the key, but I don't think that this is a proper way to implement this procedure. Any ideas?
Asked
Active
Viewed 68 times
1
-
If the used encryption is the [vigenère cipher](https://learncryptography.com/classical-encryption/vigenere-cipher) your approach is correct. In that case you are however not using a brute force attack. – Anton Nov 17 '19 at 11:48
-
Yes this is the type of encryption that is being used, but the teacher is asking for brute force attack so I can't understand how to implement this, I know everything so there is no need of trying all possible 6 length keys. – athpap Nov 17 '19 at 11:54
1 Answers
0
If you absolutely need to implement a brute force attack:
- Take the first 6 letters of the plain and encrypted text.
- For every letter, use a while loop to go over the alphabet.
- Add up the position of the letters.
- If your sum results in the letter of the encrypted text you move on the next letter in the text. If it does not, you try adding up the next letter of the alphabet in the next iteration of your while loop.

Anton
- 1,314
- 1
- 12
- 27
-
@athpap let me know if you get stuck somewhere or if something is unclear. – Anton Nov 17 '19 at 12:44