Krypton Level 1 → Level 2

Level Info

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$ ls

README  encrypt  keyfile.dat  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 /krypton/krypton2/krypton3

OMQEMDUEQMEK

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

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

krypton2@melinda:/tmp/zairo_temp$ echo "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" > a.txt

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

krypton2@melinda:/tmp/zairo_temp$ ls

a.txt  keyfile.dat

krypton2@melinda:/tmp/zairo_temp$ /krypton/krypton2/encrypt a.txt

krypton2@melinda:/tmp/zairo_temp$ ls

a.txt  ciphertext  keyfile.dat

krypton2@melinda:/tmp/zairo_temp$ cat ciphertext

MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLkrypton2@melinda:/tmp/zairo_temp$

krypton2@melinda:/tmp/zairo_temp$




Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> bef = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
>>> aft = "MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL"
>>> kryp = "OMQEMDUEQMEK"
>>> key = ""
>>> for ch in kryp:
	key += bef[aft.index(ch)]

	
>>> key
'caesariseasy'
>>>

'Challenge > OverTheWire - Krypton' 카테고리의 다른 글

OverTheWire – Krypton Level 2  (0) 2015.06.12
OverTheWire – Krypton Level 1  (0) 2015.06.12
OverTheWire – Krypton Level 0  (0) 2015.06.12

Krypton Level 0 → Level 1

Level Info

The password for level 2 is in the file ‘krypton2’. It is ‘encrypted’ using a simple rotation. It is also in non-standard ciphertext format. When using alpha characters for cipher text it is normal to group the letters into 5 letter clusters, regardless of word boundaries. This helps obfuscate any patterns. This file has kept the plain text word boundaries and carried them to the cipher text. Enjoy!

지난 문제에서 SSH로 접속하여 풀라고 하였으니 접속해보도록 하자.

krypton1@melinda:/krypton/krypton1$ ls

README  krypton2

krypton1@melinda:/krypton/krypton1$ cat README

Welcome to Krypton!


This game is intended to give hands on experience with cryptography

and cryptanalysis.  The levels progress from classic ciphers, to modern,

easy to harder.


Although there are excellent public tools, like cryptool,to perform

the simple analysis, we strongly encourage you to try and do these

without them for now.  We will use them in later excercises.


** Please try these levels without cryptool first **



The first level is easy.  The password for level 2 is in the file

'krypton2'.  It is 'encrypted' using a simple rotation called ROT13.

It is also in non-standard ciphertext format.  When using alpha characters for

cipher text it is normal to group the letters into 5 letter clusters,

regardless of word boundaries.  This helps obfuscate any patterns.


This file has kept the plain text word boundaries and carried them to

the cipher text.


Enjoy!

krypton1@melinda:/krypton/krypton1$

krypton1@melinda:/krypton/krypton1$ cat krypton2

YRIRY GJB CNFFJBEQ EBGGRA

krypton1@melinda:/krypton/krypton1$


위의 "YRIRY GJB CNFFJBEQ EBGGRA" 문자를 ROT13 알고리즘을 이용해 복호화 하라고 한다.

필자는 Python을 이용해 직접 프로그래밍 하여 문제를 풀었다.



Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> def rot13(ch):
	lower = "abcdefghijklmnopqrstuvwxyz"
	upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	if ch.isupper():
		idx = upper.index(ch)
		return upper[(idx + 13)%26]
	elif ch.islower():
		idx = lower.index(ch)
		return lower[(idx + 13)%26]
	elif ch == ' ':
		return ' '
	else:
		return False

	
>>> st = "YRIRY GJB CNFFJBEQ EBGGRA"
>>> key = ""
>>> for i in st:
	key += rot13(i)

	
>>> key
'LEVEL TWO PASSWORD ROTTEN'
>>>

'Challenge > OverTheWire - Krypton' 카테고리의 다른 글

OverTheWire – Krypton Level 2  (0) 2015.06.12
OverTheWire – Krypton Level 1  (0) 2015.06.12
OverTheWire – Krypton Level 0  (0) 2015.06.12

Krypton Level 0

Level Info

Welcome to Krypton! The first level is easy. The following string encodes the password using Base64:

S1JZUFRPTklTR1JFQVQ=

Use this password to log in to krypton.labs.overthewire.org with username krypton1 using SSH. You can find the files for other levels in /krypton/


위의 문장을 base64로 decode 하라고 한다. 필자는 Python을 이용하여 디코드를 해보았다.


Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import base64 >>> print base64.b64decode("S1JZUFRPTklTR1JFQVQ=") KRYPTONISGREAT >>>


'Challenge > OverTheWire - Krypton' 카테고리의 다른 글

OverTheWire – Krypton Level 2  (0) 2015.06.12
OverTheWire – Krypton Level 1  (0) 2015.06.12
OverTheWire – Krypton Level 0  (0) 2015.06.12

+ Recent posts