Triad Crackme by Basse | |||
Intro | |||
|
|||
Transposition | |||
One method of
crypting a text is transposition. One simple traspose is to write out the message on two rows. Letters 1,3, 5 and so on, you write on the first row. Letters 2, 4, 6 etc. you write on the second row. The message: Row 1: Row 2: Crypted text: |
|||
Substitution | |||
Another method
is substitution where you substitute one letter with another letter.
Code Monoalphabetic substitution Clear alphabet: Crypto alphabet: Clear text: Crypto text: To crypt a text, you write out the crypto alphabet under the clear alphabet. As you may see, this is not a very strong protection. With a computer
it's easy to Monoalphabetic substitution with key Clear alphabet: Crypto alphabet: Clear text: Crypto text: It can be shown with mathematical proof, that if you use a random key
as long as the text you want to crypt, A variant to this, but with a less number of keys, is to use a key or
key phrase. Instead of a random alphabet Clear alphabet: Crypto alphabet: This can also be rotated a number of steps to. A good thing about this is that it is easy to remember the key word or
key phrase. The simplicity in combination Anyone interested in cracking a monoalphabetic text can look at the mono
crackme in the crackme's. But there is ways to break this crypto, the Arabs was the first ones out. |
|||
Frequency analysis | |||
The oldest known
description, by an Arab, to break a monoalphabetic crypto is from 800 a.c.
The trick is that in any given language there's letters that's used more frequently. If you know the letter frequency for a language, you take the letters frequency in the crypted text and substitute it with the one that have about the same frequency for that language. It's relatively easy to make a qualified guess what letter it is. The same rules can be applied on one, two, three or more, letter words. As you are a cracker, it's easy to write a small app to analyse some
text files on your computer. |
|||
Le Chiffre Indéchiffrable | |||
For many centuries
the monoalphabetic substitution crypto was the prevailing method to write
a secret text. But after the Arabs invention of the frequency analyze, this method was no longer a safe one to use. The original idea for this new crypto came from a man named Leon Battista
Alberti, born 1404. Clear alphabet: Crypto alphabet 1: Crypto alphabet 2: If we crypt the word "hello" we use the first alphabet for
h, that become A. A man named Blaise de Vigenére, born 1523, developed this idea
further. The first step to use this is to write out a Vigenére table. This
is done by writing down a clear alphabet abcdefghijklmnopqrstuvwxyzThe first row is a crypto alphabet with a Caesar roll, a rotation of one step. The second one have a two step rotation and so on. To use it, you use a new row for each letter you crypt. To decrypt the text the receiver must know which row shifts to use. Write out the key word above the message over and over, so each letter
in the message GREENGREENGREENGREENThen you create the crypto text like this: Crypt the letter b by taking the letter in the key word above, here it is G. This letter is the index to a row in the Vigenére table. The row beginning with G, row 6, is the crypto alphabet to use for the first letter b. In the row for the clear alphabet, go to the column for the letter b. To find the substitution letter, follow this column down to row 6, here you find the letter H to substitute for b. Repeat this procedure for the letter e. The key letter above e is R which
gives Repeat this for each letter in the message. Each letter in the keyword gives us a different crypto alphabet to use.
The message "beginattackatsundown" crypted with the keyword
GREEN comes out as: With a longer keyword, or a key sentence, you add more rows from the
table you make the crypto more |
|||
Charles Babbage and Vigenére | |||
As mentioned
earlier, the strength of the Vigenére crypto is that a letter can
be crypted on a number of different ways. If the keyword is KING is used, there's four different ways to crypt a given letter. The same apply to words that's crypted. The word "the" can be crypted as, DQR, BUK, GNO or ZRM depending on the words relation to the keyword KING. You get no clues from the frequency analysis. This making the decrypting much harder, but not impossible. A man named Charles Babbage, born 1791, was the first one to break this
kind of crypto. He thought that if there's only four ways to crypt the word "the",
and the word is used many times in the text, Babbage stated some fairly simple steps to break the Vigenére
crypto. If you found out that the keyword is five letters, you use the first
alphabet for letter 1, 6 ,11 and so on. Implementing Vigenére in ASM Crypting: Decrypting: To understand the code above, remember that the Vigenére table
is just 26 alphabets where each one is Another way to look at it is, go to the "K" column of the alphabet
starting with "A", column 10 (or "A" - "K",
We apply the same rules for the decryption, but here we subtract the
key character from the crypted character. @Detten add link vigenere.asm And last, an exercise in Vigenére: QSTC IU DMY OBOFGBJHNX KEVGJYY XAOVSH UYW TIPUD? Avoiding Vigenére In this crypto you substitute a letter with many letters, and the number
of substitute characters is An example of homophonic substitution crypto. Here number is used. With a frequency of 1% for every character, there's no way to use In english the letter q is always followed by the letter u. No other
letter can follow q. If we find a character in the crypted text that is always followed by
the same three characters, At first glance, the homophobic substitution crypto seems to be some
kind of polyalphabetic crypto. @Detten add link homo.asm homo.inc
|
|||
Playfair | |||
The playfair crypto
was created by Lyon Playfair. This crypto substitutes every two letters
in the clear text with another letter pair. To crypt and decrypt a text, the sender and receiver must first agree on a keyword to use. The crypto is used like this. C H A R L Then you divide the message into letter pairs, called bigram. Every bigram
must consist of two different letters. Clear text: Text in bigram: Then the crypting start. 1 If both letter is in the same row, substitute them with the letter
to the right if each one. 2 If both letters is in the same column, substitute them with the letter in the column below each one. GE becomes OG. If one letter is in the last row, substitute it with the letter from the first row. YR becomes RD. 3 If neither 1 or 2 apply, we do like this. To crypt the first letter,
follow the row it's on until you The bigram text: The crypted text:
|
|||
ADFGVX crypto | |||
In ADFGVX crypto, both substitution and transposition is used. The crypto
is used like this. A D F G V X The first step is to look at in which row and column each letter in the
text is. Message: Crypt step 1: So far it is a simple monoalphabetic substitution crypto, breakable with
frequency analysis. The transposition is done like this: Then arrange the columns so that the letters in the keyword is sorted
from a to z. M A R K -> A K M R The reason for using A, D, F, G, V and X is that they are the letters
in the Morse alphabet that
|
|||
Final notes | |||
If you are interested in the subject and want to read more, I can recommend Keep on cracking Basse
|
|||
|