Crypto Series: Introduction to Cryptool
In this post we'll see some of the options provided by Cryptool to analyze classical ciphers, as well as using it for breaking a ciphertext encrypted with Vigenère's cryptosystem.
First step, as usual, consists of installing Cryptool. To that end, I chose using a virtual machine in VMWare with Windows XP. The installation is very simple, typical Windows app installation: Next, Next,... We'll use the English version, which is the one I have installed, but it shouldn't be difficult to follow our steps with a different version.
Once installed, this is how the main window of Cryptool looks like:
Looking at the menus, one can see that Cryptool offers (amongst others) the possibility to encrypt and decrypt texts, cryptanalytic tools and guided tutorials. In this text we'll see how to use Cryptool for analyzing encrypted texts... Let's start with an easy one:
Gznyrém xlmlxrwz xlnl Fmrevihrwzw Klorgéxmrxz wv Ezovmxrz, l vo
Klor kziz olh znrtlh, vh fm lhxfil oftzi oovml wv vhgfwrl b kvievihróm.
Hlyivglwl, klijfv glwl zjféo ol hfurxrvmgvnvmgv olxl xlnl kziz vmgizi
vm vooz, gvmwiá jfv szxvi zotl wv ol zmgvirlinvmgv xrgzwl kziz hzori
zrilhl wv vooz. Vmgiv olh oftzivh náh xlmxfiirwlh, hv vmxfvmgizm oz
Xzhz wvo Zofnml (szyrgfzonvmgv fhzwz kziz wlinri olh qfvevh wv
nzwiftzwz, kvil gznyrém kziz qftzi z yroozi l ufgyloím, zfmjfv mlh
jfrgzm vhgv vm éklxz wv vcánvmvh), oz Yryorlgvxz (wlmwv oz tvmgv hv
wrervigv vhgfwrzmwl), b ozh krhgzh wv gvmrh b káwvo.
The text has been obtained from IEEE's cryptography challenge, by Javi Moreno and Amine Tourisa (sorry, Spanish). Actually, the solution was already published in Javi's blog, but we're gonna see how to obtain it with Cryptool:
- Create a new document ( File | New )
- Copy the text from the challenge
- Go to Analysis | Tools for Analysis | Histogram
Now we get the following frequency diagram from the text:
Next we just compare this diagram with the typical one from Spanish or English, and we can see that it's simply been 'mirrored'... easy, isn't it? So the answer is, as you probably guessed, ATBASH. Decrypting the text with ATBASH (Crypt/Decrypt | Symmetric (Classic) | Substitution/Atbash ... ) , we get this cleartext (again, Spanish):
También conocida como Universidad Politécnica de Valencia, o el Poli para los amigos, es un oscuro lugar lleno de estudio y perversión. Sobretodo, porque todo aquél lo suficientemente loco como para entrar en ella, tendrá que hacer algo de lo anteriormente citado para salir airoso de ella. Entre los lugares más concurridos, se encuentran la Casa del Alumno (habitualmente usada para dormir los jueves de madrugada, pero también para jugar a billar o futbolín, aunque nos quitan este en época de exámenes), la Biblioteca (donde la gente se divierte estudiando), y las pistas de tenis y pádel.
Now we'll see how to solve a Vigenère encrypted text. Let's take as our working example the following text:
Yyi plqqsjiw icd rfwx vcrynevh ozi fxlhf bwrgxlqmq nsvng mwv hivwssvh
xr hmpv eadm ktlv jusqifq xr gtfii eqr omrrkh htj nsvng. Nd tsrwfmxk,
xlh UZZ Xirhfmq Gyfowo Qzgiqgq nj mrwszivh xr ugfierwsq dfyv ifqjusq wc
emrvi dbp hyerjs mqc ziugutew si o bwfkvda--ft deoh ggwv mx usyfzrw ifqj
jsjwkmwv jsu oxq zxw xgqwj. Ai, wvq Kiii Vcrynevh Tazehewwas, lwi wvq
LEY Khbqwrp Txpxnt Pmfszxv jsu aaxk sj rid xfjxzodj; zx esdxnvw eoga yf
erb cfmvv arfw wvpidgqi klmv kmd sc mwg mzklsug. Ktl geq obucc mw ha
dfyv sfalieqv, hat.Nliq kq xgien cr kiii vcrynevh, kq fii vhtqwimrj ha kiiigcy, sfx
tuwoj. Fyv Jszjiep Sinqzg Plqqsjiw dfq ivwmjbqi ks qdyq xlvi wvmy psy
kohj kli ifqjusq wc pnjxvlpgyv gsswqx fj jusq xfjxzodj (rrh fvmwxi jrf
fmvq mi maz nmwk), htfk csx fqhvmzh gazigi fcpj fv gdb sjk mx lt ktl
aeqh uy, klew maz ter fvmsxi xks etwxadfq ti ywh dujtiw rt uy zr rhk
rwvi tucswrqw, dbp yyex bcg pesa bcg hrr hr htjji xkwzlj.Xs sfayvgx bcgw imkkhe, bv rihr ft gviyszy fxlhfe kisq gszdzrk bcg
yyiwh fulyxw rf mxbmrj maz ks wxfdjehiu htj imkkhe. Yyivhtawv, csx vmav
giuhmne vivdasjmflzuyziw lt ktl hmvhdnsyxh qauziw rt fmv wsihifii, su wr
dfy qrrukp mx: useufrwlpuqzxmhg ft iiwssoy kli ifqjusq rt ayyivv.
Again, we create a new document in Cryptool and paste the text in. Now we go to Analyze | Symmetric Encryption (Classic) | Ciphertext-Ony | Vigenere.
After doing so, Cryptool will suggest a key length, and when we accept, it will tell us the key and allow us to decrypt the complete text, this time in English. We can also choose to see every step, with the Show base ciphers analysis option in Options | Analysis Options.
Further, Cryptool's output offers a plot with the text's autocorrelation, with periodic peaks in multiples of the key length 🙂 This is the tool used by Cryptool to analyze Vigenère's cryptograms, and we can also find it directly available in Analyze | Manual | Autocorrelation. This tool can be used to analyze texts and decide whether it could be a Vigenère (or similar) cipher or not.
That's it for today, I recommend you to keep on playing with Cryptool and to take a look at its official documentation.
June 2nd, 2009 - 13:32
Si usáis linux Cryptool funciona bien con Wine (por lo menos la versión 1.4) y siempre podemos usar jCryptool, que pretende ser el sucesor, hecho en Java.
June 2nd, 2009 - 21:51
Bien bien, a ver si ahora tienes un poco más de tiempo y nos iluminas 🙂