title: Java caesars cipher brute forcing
body: <p>I am new in Java and I need to write an algorithm for cracking Caesar's cipher using brute force and then matching the words from the dictionary to find the correct shift. That's the code I have written so far. I would really appreciate if somebody helps me with the implementation of shifting the letters and matching them with the file dictionary.txt.</p>
  
  <pre><code>private char[] alphabet = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
  private char[] decodedText;
  private String plainText;
  
  public String producePlaintext(String cipherText) {
      //put each letter of the ciphertext in an array of characters in the upper case format
      char[] message = cipherText.toUpperCase().toCharArray();
      //loop through all the possible keys
      for (int key = 0; key &lt; alphabet.length; key++) {
          //set the value of the decrypted array of characters to be the same as the length of the cipher text
          decodedText = new char[message.length];
          //loop through the characters of the ciphertext
          for (int i = 0; i &lt; message.length; i++) {
  
              //if character is not space
              if (message[i] != ' ') {
                  //shift the letters
  
              }else{
                  decodedText[i] = ' ';
              }
          }
          plainText = String.valueOf(decodedText);
      }
      return plainText;
  }
  </code></pre>