Krypton2 - krypton3

From JaxHax
Jump to navigation Jump to search

Level Goal

Substitution ciphers are a simple replacement algorithm. In this example of a substitution cipher, we will explore a ‘monoalphebetic’ cipher. Monoalphebetic means, literally, “one alphabet” and you will see why.


This level contains an old form of cipher called a ‘Caesar Cipher’. A Caesar cipher shifts the alphabet by a set number. For example:

plain:  a b c d e f g h i j k ... 
cipher: G H I J K L M N O P Q ...


In this example, the letter ‘a’ in plaintext is replaced by a ‘G’ in the ciphertext so, for example, the plaintext ‘bad’ becomes ‘HGJ’ in ciphertext.


The password for level 3 is in the file krypton3. It is in 5 letter group ciphertext. It is encrypted with a Caesar Cipher. Without any further information, this cipher text may be difficult to break. You do not have direct access to the key, however you do have access to a program that will encrypt anything you wish to give it using the key. If you think logically, this is completely easy.


One shot can solve it!


Have fun.


Solution

I used the tool at http://rumkin.com/tools/cipher/caesar.php to solve this one...

krypton2@melinda:~$ cd /krypton/krypton2/

krypton2@melinda:/krypton/krypton2$ ls -la
drwxr-xr-x 2 root     root     1024 Nov 14 10:32 .
drwxr-xr-x 8 root     root     1024 Nov 14 10:32 ..
-rw-r----- 1 krypton2 krypton2 1060 Nov 14 10:32 README
-rwsr-x--- 1 krypton3 krypton2 8962 Nov 14 10:32 encrypt
-rw-r----- 1 krypton3 krypton3   27 Nov 14 10:32 keyfile.dat
-rw-r----- 1 krypton2 krypton2   13 Nov 14 10:32 krypton3

krypton2@melinda:/krypton/krypton2$ cat README 
Krypton 2

ROT13 is a simple substitution cipher.

Substitution ciphers are a simple replacement algorithm.  In this example
of a substitution cipher, we will explore a 'monoalphebetic' cipher.
Monoalphebetic means, literally, "one alphabet" and you will see why.

This level contains an old form of cipher called a 'Caesar Cipher'.
A Caesar cipher shifts the alphabet by a set number.  For example:

plain:	a b c d e f g h i j k ...
cipher:	G H I J K L M N O P Q ...

In this example, the letter 'a' in plaintext is replaced by a 'G' in the
ciphertext so, for example, the plaintext 'bad' becomes 'HGJ' in ciphertext.

The password for level 3 is in the file krypton3.  It is in 5 letter
group ciphertext.  It is encrypted with a Caesar Cipher.  Without any 
further information, this cipher text may be difficult to break.  You do 
not have direct access to the key, however you do have access to a program 
that will encrypt anything you wish to give it using the key.  
If you think logically, this is completely easy.

One shot can solve it!

Have fun.

krypton2@melinda:/krypton/krypton2$ cat krypton3 
OMQEMDUEQMEK

krypton2@melinda:/krypton/krypton2$ ./encrypt 

 usage: encrypt foo  - where foo is the file containing the plaintext

krypton2@melinda:/krypton/krypton2$ echo test > /tmp/krypton2_test

krypton2@melinda:/krypton/krypton2$ ./encrypt /tmp/krypton2_test
failed to create cipher file 

krypton2@melinda:/krypton/krypton2$ ./encrypt /tmp/krypton2_test

krypton2@melinda:/krypton/krypton2$ mkdir /tmp/feof

krypton2@melinda:/krypton/krypton2$ chmod 777 /tmp/feof

krypton2@melinda:/krypton/krypton2$ cd /tmp/feof

krypton2@melinda:/tmp/feof$ echo test > /krypton2_test

krypton2@melinda:/tmp/feof$ ln -s /krypton/krypton2/keyfile.dat 

krypton2@melinda:/tmp/feof$ ls
encrypt  keyfile.dat  krypton2_test

krypton2@melinda:/tmp/feof$ ./encrypt krypton2_test 
failed to open keyfile 

krypton2@melinda:/tmp/feof$ rm encrypt 

krypton2@melinda:/tmp/feof$ ln -s /krypton/krypton2/encrypt ./encrypt

krypton2@melinda:/tmp/feof$ ./encrypt 

 usage: encrypt foo  - where foo is the file containing the plaintext

krypton2@melinda:/tmp/feof$ ./encrypt krypton2_test 

krypton2@melinda:/tmp/feof$ ls

ciphertext  encrypt  keyfile.dat  krypton2_test

krypton2@melinda:/tmp/feof$ cat ciphertext
FQEF

krypton2@melinda:/tmp/feof$ echo -e "abcdefghijklmnopqrstuvwxyz\n" > krypton2_test 

krypton2@melinda:/tmp/feof$ ./encrypt krypton2_test 

krypton2@melinda:/tmp/feof$ cat ciphertext 
MNOPQRSTUVWXYZABCDEFGHIJKL


So this is a good test... The permissions were the biggest pain to work through, but we basically have our key!

plaintext:  ABCDEFGHIJKLMNOPQRSTUVWXYZ 
ciphertext: MNOPQRSTUVWXYZABCDEFGHIJKL


So if we use the the letter on the top we can translate it. This is good as it we can use this in reverse too. Our password was "OMQEMDUEQMEK". We can just look at the key above and translate it.

CipherText: OMQEMDUEQMEK
PlainText:  CAESARISEASY


let's just verify it by crypting the plain text and verify we get the expected cipher text...

krypton2@melinda:/tmp/feof$ echo -e "CAESARISEASY\n" > krypton2_test 

krypton2@melinda:/tmp/feof$ ./encrypt krypton2_test 

krypton2@melinda:/tmp/feof$ cat ciphertext 
OMQEMDUEQMEK

krypton2@melinda:/tmp/feof$


And Done Son!