Re: Programming project #1



laura fairhead wrote:


> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PROJECT #1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Simple cipher breaker
>
> A simple (substitution) cipher is defined as;
>
> f{0,1,2,......,n} -> {a0,a1,a2,.....,an}
>
> 0,1,2,....,n represent the bytes to be encoded
> a0,a1,a2,... represent the codes to replace them with

I hope you don't mean any function which converts a
(n+1) byte input string to an (n+1) byte output string
but a byte wise conversion: ai = f(i) i=0..n, where
f is identical for all bytes of the input string.



> the decrypted message. It will do this by making the assumption
> that the original (cleartext) message was in plain English.
> The program can use a dictionary data file to help it determine
> what might be plain English.

If the text is long enough, it should be sufficient to
calculate the distribution for the letters (a-z) and letter
pairs (aa, ab, .. zy, zz) and compare this with the
average values for an english text. The final correction
can be done interactive (you have to do this for the digits
anyhow). I think the use of a dictionary is to much work
for the improvement you get.


But why not solve a real challenge:

http://www.rsasecurity.com/rsalabs/node.asp?id=2091
.