Cipher Cryptanalysis Implementantion

75 Views Asked by At

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?

1

There are 1 best solutions below

1
Anton On

If you absolutely need to implement a brute force attack:

  1. Take the first 6 letters of the plain and encrypted text.
  2. For every letter, use a while loop to go over the alphabet.
  3. Add up the position of the letters.
  4. 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.