Hello,
I'm doing some work on Frequency Analysis and decrypting text..
Basically, this is how I think it works...
You take the alphabet (as a char)
alphabet[26] = {'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'};
Then you read in the string you want to analyse
crypt[26] = {'c', 'a', 'b', 'e', 'f', 'f', 'a', 'a'};
Then you calculate how many times each character is used. e.g.
a = 3;
b = 1;
c = 1;
e = 1;
What you do after that is confusing me.. So do you:
1) Swop the values according to how frequent they are displayed in the alphabet? e.g.
if b was most frequent in the alphabet
then
swop b with a;
end
2) Swop pairs of values?
I'm really confused and looking for some guidance, thanks :)