\(\(alphabet0 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";\)
\)
frequency[
          txt_] :=  (FT  = 
            Array[Function[
                i, {Characters[alphabet0][[i]], 
                  Count[Characters[
                      txt], Characters[alphabet0][[i]]]}], 
              26]; 
FT  =  
            Transpose[FT]; 
FT  =  
            Transpose[{FT[[2]]/N[Apply[Plus, FT[[2]]]],  
                FT[[1]]}]; 
Reverse[
            Sort[FT]]);

SubstCipher[key_, text_]  :=  
        StringReplace[text, 
          Table[StringTake[alphabet0, {i}]  ->  StringTake[key, {i}], {i, 
              1, 26}]];

CipherText  =  "KRJ NJZKQCY GZKJYYGFJZNJ CFJZNV DCO NQJCKJM GZ \
IGIKV IGBJ VJCQO CFT DGKR KRJ OGFZGZF TI KRJ ZCKGTZCY OJNUQGKV CNK AV \
HQJOGMJZK KQUPCZ KRJ ZCKGTZCY OJNUQGKV CNK NRCQFJM KRJ MGQJNKTQ TI NJZKQCY \
GZKJYYGFJZNJ DGKR NTTQMGZCKGZF ZCKGTZCY GZKJYYGFJZNJ CNKGBGKGJO CZM \
NTQQJYCKGZF JBCYUCKGZF CZM MGOOJPGZCKGZF GZKJYYGFJZNJ DRGNR CIIJNKO ZCKGTZCY \
OJNUQGKV KRJ NGC GO CZ GZMJHJZMJZK CFJZNV QJOHTZOGAYJ KT KRJ HQJOGMJZK CZM \
CNNTUZKCAYJ KT KRJ CPJQGNCZ HJTHYJ KRQTUFR KRJ GZKJYYGFJZNJ TBJQOGFRK \
NTPPGKKJJO TI KRJ UO NTZFQJOO";

frequency[CipherText]

Guess from frequencies that J is e:

SubstCipher["ABCDEFGHIeKLMNOPQRSTUVWXYZ", CipherText]

Now guess that K is t:

SubstCipher["ABCDEFGHIetLMNOPQRSTUVWXYZ", 
      CipherText]

The first word (tRe) suggests that R is h:

SubstCipher["ABCDEFGHIetLMNOPQhSTUVWXYZ", CipherText]

The word tT suggests that T is o:

SubstCipher["ABCDEFGHIetLMNOPQhSoUVWXYZ", CipherText]

The word oI suggests that I is f or n or r .   I has low frequency and n and r are common,  
    so guess that I is f:

SubstCipher["ABCDEFGHfetLMNOPQhSoUVWXYZ", CipherText]

There are several 2 - 
      letter words (GZ AV GO CZ) not involving e,  o,  t,  
    or f .   This suggests G is i and C is a:

SubstCipher["ABaDEFiHfetLMNOPQhSoUVWXYZ", CipherText]

Now fiftV suggests V is y,  
fiBe suggests B is v,  
Dith suggests that D is w,  
    ZatioZaY suggests that Z is n and Y is l,  
    and NoPPitteeO suggests N is c  P is m and O is s:

SubstCipher["AvawEFiHfetLMcsmQhSoUyWXln", CipherText]

The rest is clear :  Q is r,  F is g,  M is d,  
    U is u,  A is b,  H is p:

SubstCipher["bvawEgipfetLdcsmrhSouyWXln", CipherText]

\(Note\ that\ the\ actual\ frequecies\ in\ this\ message\ do\ not\ come\ in\ the\ same\ order\ as\ the\ frequencies\ in\ "normal"\ English\ text . \ We\ had\ to\ use\ digrams\ ad\ short\ words\ to\ break\ the\ \(\(cipher\)\(.\)\)\)