Welcome Guest [Log In] [Register]
Viewing Single Post From: Arcanum (another new cipher)
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
The classic Viigenere used a Caesar shift with a rotating key, where the primitive encryption operation was c=p+k (c=ciphertext, p=plaintext, k=key). Decryption reversed this: p=c-k. The Beaufort cipher (officially invented by Admiral Francis Beaufort, though some believe it was really the work of his friend and colleague, Charles Babbage) is the same as the Vigenere, except that it changes the primitive to c=k-p. There are two other possibilities, c=p-k, which is called the Variant Beaufort, and c=-p-k, which never seems to have picked up a name.

You'll notice that Variant Beaufort encryption is exactly the same as Vigenere decryption. Beaufort, though, is unique. Since c=k-p, p=k-c. The process for encryption and decryption is exactly the same.

What you have is a minor variation on the Vigenere family of periodic polyalphabetic ciphers. You are using as a primitive c=2*k-p. If you think about that, that's simply the same as c=k'-p, using a different key. In other words, it's the Beaufort cipher.

Your example uses the key CRYPTO. If you do a Beaufort encryption using the keyword FJXFND, you get the same result. (Actually, it's usual to assign the integers A=0, instead of A=1, as you have, so for most Beaufort software, the key would be EIWEMC).

Cryptanalysis of the Beaufort is pretty much identical to cryptanalysis of the Vigenere - use the Index of Coincidence to determine the key length, then use the chi^2 test to identify the necessary shifts.

Your example text is very short, but running it through vigsolve (click here) correctly identifies the keylength.

Code:
 
Index of Coincidence and Periodic Key Find

23 Characters read, 19 Alphas

Len     Index    Vigenere         Var. Beaufort    Beaufort
---     ------   c = p+k          c = p-k          c = k-p
                 p = c-k          p = c+k          p = k-c
                 k = c-p          k = p-c          k = p+c
  2   0.058333   ee                         ww                         mk
  3   0.076190   aey                        awc                        eqy
  4   0.050000   eeik                       wwsq                       eidq
  5   0.000000   eteet                      whwwh                      jalqx
  6   0.111111   aesaiy                     awiasc                     ebegzj
  7   0.047619   tetruzi                    hwhjgbs                    xlevqja
  8   0.041667   meiyzqwe                   owscbkew                   eizcfiol
  9   0.037037   meuoixata                  owgmsdaha                  eocgmdsqi


Note that a keyword length of 6 yields the higheest IC, but only one of the letters in the key is properly assigned. With a text as short as this, the statistics are often unclear.

Using the same key on a longer text works better. Text:

Quote:
 
NXEVK SQVNG NXAKM DLWLM TGBQA ORYHV NBRIL QXXNO KVNIL ZZQNX OMRSA JGSFQ
QZXGM DAZTS GCAJS SFWLB WTXYW PDYMD WJQWZ WBKAG OUNNY PZXSX NODFE KLZVB
NZTYN IWOYF LVLJL SDVNR WTXJM XEULP RIEYM RXNKV WRKYB CMYGJ PPRWY HPYMQ
XXSYW GTXQB GCAPE ESBRX NSLX


Result:

Code:
 
Index of Coincidence and Periodic Key Find

245 Characters read, 204 Alphas

Len     Index    Vigenere         Var. Beaufort    Beaufort
---     ------   c = p+k          c = p-k          c = k-p
                 p = c-k          p = c+k          p = k-c
                 k = c-p          k = p-c          k = p+c
  2   0.050281   ..                         ..                         e.
  3   0.048142   ...                        ...                        ...
  4   0.048235   ....                       ....                       e.e.
  5   0.044278   .....                      .....                      .....
  6   0.064765   jv....                     rf....                     ebegzj
  7   0.039573   .......                    .......                    .......
  8   0.049455   y.l.....                   c.p.....                   e.e.....
  9   0.048832   .v.u.....                  .f.g.....                  eb.as...e
 10   0.055038   ...ft..k..                 ...vh..q..                 ..eqek.qyj


You'll note that it not only identified the key length, it correctly identified each of the key letters. On texts of moderate length, this will usually be the case. On shorter textx, usually only some of the individual key letters will be identified.

I wrote up something about how this method works in other threads:

Cracking a Vig with IC

The Index of Coincidence - the Chi Test, the Kappa Test, and the mixed-alphabet Vig

When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post
Arcanum (another new cipher) · General