title: How to find the encryption key of a shift cipher?
body: <p>So i got an assignment and i need to decrypt a string that was encrypted with a certain key in a shift cipher. So my flow of thought was to find the most common letter in the string and find the key from that because the most common letter is E and when i will get the key i will decrypt the text (just basically each letter in the string that isn't a space - the key. Now i faced a few difficulties:</p>
  
  <ol>
  <li><p>I want my program to work for every key so I don't know if the most common letter is after or before E(in the ASCII chart) So i can't just substrate E and get the answer and i can't figure out what math things i need to do to make it work.                                                                       </p></li>
  <li><p>Also when i found the key i don't know how to make like for example <code>A</code> go back to <code>Y</code>, like doing the circle (but i think i know maybe how i think with the <code>%</code> operator)</p></li>
  </ol>
  
  <p>Anyway anyone that could help is much appreciated and i'm not allowed for really advanced commands. Also all letters in the String are caps and the cipher is a simple shift cipher.</p>