Welcome to the JavaRanch, Ewan. We love to talk
Java and programming but we get a lot of people coming here with homework questions, so we ask that you do the work and come to us with code and specific questions. To get you started, here's an article on
Frequency Analysis with an example on how it works.