Skip to content

Commit

Permalink
More cryptography sections redone
Browse files Browse the repository at this point in the history
  • Loading branch information
cabreraalex committed May 28, 2014
1 parent 3579acd commit cbe02fc
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 76 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ CTFs, especially for beginners, can be very daunting and almost impossible to ap

##Quick Start

1. First time? Read down below to learn more about CTFs, and then use the resources in the [topics](./topics/) directory to try to solve challenges on websites like [OverTheWire](https://overthewire.org/wargames/) or [CanYouHack.it](https://canyouhack.it/) and later on [ctftime](https://ctftime.org/).
1. First time? Read down below to learn more about CTFs, and then use the resources in the [topics](./topics/) directory to try to solve challenges on websites like [OverTheWire](https://overthewire.org/wargames/) or [CanYouHack.it](https://canyouhack.it/).

2. Beginner? Use the guides found in the [topics](./topics/) directory to try to find out what type of challenges you are presented with and participate in some of the CTFs presented on [ctftime](https://ctftime.org/).
2. Beginner? Use the guides found in the [topics](./topics/) directory to try to find out what type of challenges you are presented with and participate in some of the CTFs on [ctftime](https://ctftime.org/).

3. Intermediate? Navigate straight to the topic you are interested in to find extra online resources to help you solve more complex challenges.

Expand All @@ -18,7 +18,7 @@ CTFs, especially for beginners, can be very daunting and almost impossible to ap

CTFs are computer security/hacking competitions which generally consist of participants breaking, investigating, reverse engineering and doing anything they can to reach the end goal, a "flag" which is usually found as a string of text.

[DEF CON](https://en.wikipedia.org/wiki/DEF_CON) hosts what is the most widely known and first major CTF, occuring annualy at the hacking conference in Las Vegas. Many different competitions have branched off since then, and numerous ones are available year round. One of the best places to see when CTFs are being scheduled is [ctftime](https://ctftime.org/), an active website with calendars and team rankings.
[DEF CON](https://en.wikipedia.org/wiki/DEF_CON) hosts what is the most widely known and first major CTF, occurring annually at the hacking conference in Las Vegas. Many different competitions have branched off since then, and numerous ones are available year round. One of the best places to see when CTFs are being scheduled is [ctftime](https://ctftime.org/), an active website with calendars and team rankings.

###Example

Expand Down
10 changes: 5 additions & 5 deletions topics/cryptography/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

1. Is the text relatively small? a few sentences?

* Is the text 32 characters long? This is most likely an [md5](./md5/) hash
* Is the text 32 characters long? Most likely an [md5](./md5/) hash

* Is it 40 characters long? Most likely a [SHA1](./sha1/) hash
* 40 characters long? Most likely a [SHA1](./sha1/) hash

* Are there equal signs spread out through the text and often next to each other? Probably a [base64](./base64/) encoded string
* Are there equal signs spread out through the text, often next to each other? Probably a [base64](./base64/) encoded string

* Is the text only letters?
* Is the text only letters, without numbers or special characters?

* Check if it is a [Caesar](./caesar-cipher/) or [Vigenere](./vigenere-cipher/) cipher
* Check if it is a [Caesar](./caesar-cipher/), [Vigenere](./vigenere-cipher/), or other type of cipher

* Rarely, it may be a keyboard map as found in the [Olympic CTF 2014](https://github.com/ctfs/write-ups/tree/master/olympic-ctf-2014/crypting)

Expand Down
30 changes: 10 additions & 20 deletions topics/cryptography/caesar-cipher/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
#Caesar Cipher

The [Caesar Cipher](https://en.wikipedia.org/wiki/Caesar_cipher) is a very simple and common encryption method which does not appear often in full-fledged CTFs but forms part of the basis of cryptography. It simply shifts a string of letters a certain number of positions up or down the alphabet.
The Caesar Cipher is a very simple and common encryption method which shifts a string of letters a certain number of positions up or down the alphabet.

Let's say we want to encrypt the string `hello world` to give to our friend whose favorite number is 3. We will shift our string **left 3**.
##Use

Taking the first letter `h` in our string and going 3 places up the alphabet(as it is a left shift) gives us the letter `e`. We then start our new, encrypted string with the letter.
* Create:

Doing so for the whole original string creates a jumbled mess of incomprehensible letters to anyone but the reader with the proper decryption shift:
* Online [here](https://tools.zenverse.net/caesar-cipher/)

**Original:** `hello world`
* [Python script](https://www.stealthcopter.com/blog/2009/12/python-cryptography-caesar-shift-encryption-shift-cipher/)

**Final:** `ebiil tloia`
* Crack:

To let our friend read this, we would send him the final string with the instructions **right 3**, and either by hand, with a website, or with a script, he would be able to extract our message.
* Online [here](https://tools.zenverse.net/caesar-cipher/)

##Detecting
* [Bash script](https://www.linux-support.com/cms/chris-lamb-decrypting-the-caesar-cipher-using-shell/)

Caesar ciphers are usually presented in very low-point tasks, if at all, and can be easy to detect and check for. Strings containing incomprehensibly jumbled letters are possible Caesar ciphers and should be checked.
##More

##Solving

There are many approaches to cracking Caesar ciphers, but usually the best way to solve them is to write a script or run the string through [a website](https://www.xarg.org/tools/caesar-cipher) which will print out all the possible shifts of a string. From those results the most comprehensible and logical solution can be chosen.

##CTF Example

*To-do*

##Sources/See More

[Brute force caeser cipher cracker](https://nayuki.eigenstate.org/page/automatic-caesar-cipher-breaker-javascript)
[Caesar Cipher](https://en.wikipedia.org/wiki/Caesar_cipher)
1 change: 0 additions & 1 deletion topics/cryptography/caesar-cipher/example.txt

This file was deleted.

2 changes: 1 addition & 1 deletion topics/cryptography/md5/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#MD5 Hashing

MD5 is hashing function which creates a 16-byte hash value (usually represented as a 32 digit hexadecimal number) from any file.
MD5 is a hashing function which creates a 16-byte hash value (usually represented as a 32 digit hexadecimal number) from any file.

#Use

Expand Down
1 change: 0 additions & 1 deletion topics/cryptography/md5/example.txt

This file was deleted.

20 changes: 6 additions & 14 deletions topics/cryptography/rsa/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
#RSA

*To-do*
RSA is a public-key cryptosystem which uses a public-private key pair to encrypt and decrypt information securely.

##Detecting
##Use

*To-do*
* RSA library in [python](https://pypi.python.org/pypi/rsa) with easy to use [docs](https://stuvel.eu/files/python-rsa-doc/usage.html)

##Solving
* [Thorough explanation](https://www.muppetlabs.com/~breadbox/txt/rsa.html) of RSA with a [simple crack example](https://www.muppetlabs.com/~breadbox/txt/rsa.html#13)

*To-do*
##More

##CTF Example

BackdoorCTF 2014 had an RSA challenge which simply provided a [public key](ctfexample-key.pub) and encrypted [text file](ctfexample-text.txt).

The solution can be found [here](https://singularityctf.blogspot.ru/2014/03/backdoorctf-2014-writeup-crypto-100-eng.html).

##Sources/See More

[CTF Write-up](https://singularityctf.blogspot.ru/2014/03/backdoorctf-2014-writeup-crypto-100-eng.html)
[RSA](https://en.wikipedia.org/wiki/RSA_algorithm)
4 changes: 0 additions & 4 deletions topics/cryptography/rsa/ctfexample-key.pub

This file was deleted.

Binary file removed topics/cryptography/rsa/ctfexample-text.txt
Binary file not shown.
22 changes: 6 additions & 16 deletions topics/cryptography/vigenere-cipher/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
#Vigenère Cipher

> The Vigenère Cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword - [Wikipedia](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher).
The Vigenère Cipher is an encrypting method which uses a series of different Caesar ciphers based on the letters of a keyword

Please read the article on [Caesar Ciphers](../caesar-cipher) if you haven't already because the Vigenère Cipher is a direct derivative of the former. The Vigenère cipher takes a keyword and applies a certain caeser cipher to it multiple times according to the letters of a keyword.
##Use

*To-Do Example*
* Create:

##Detecting
* Online [here](https://sharkysoft.com/vigenere/)

Vigenère Ciphers appear to be identical to any other substitution cipher, but trying to solve it as Caesar Cipher will not work. Check for this type of cipher if the Caesar Cipher crack does not work.
* Crack:

##Solving

*To-Do*

##CTF Example

DEKTHON 2014 had a simple vigenère cipher with no hints and only a line of text:

`ucoizsbtkxhtadcg`

Solution can be found [here](https://github.com/ctfs/write-ups/tree/master/defkthon-ctf/crypto-100).
* Online [here](https://smurfoncrack.com/pygenere/index.php)

##Sources/See More

Expand Down
1 change: 0 additions & 1 deletion topics/cryptography/vigenere-cipher/ctfexample.txt

This file was deleted.

16 changes: 6 additions & 10 deletions topics/steganography/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#Steganography

> Steganography is the art or practice of concealing a message, image, or file within another message, image, or file. - [Wikipedia](https://en.wikipedia.org/wiki/Steganography)
1. If the file is an image, see [File in an Image](./file-in-image/) or [Hidden Text](./invisible-text/]

In the context of CTFs steganography usually involves finding the hints or flags that have been hidden with steganography. Most commonly a media file will be given as a task with no further instructions, and the participants have to be able to uncover the message that has been encoded in the media.

###Example

Images are a very common medium for steganography, as they are easy to manipulate and simple to view and transport. [Files in Images](file-in-image) give a good introduction for beginner steganography.
##About

##Getting Started
Steganography involves concealing a message, image, or file within anotVher message, image, or file.

A rudimentary knowledge of media filetypes (e.g. jpg, bmp, png for pictures and wav, mp3 for sound) is essential to steganography, as understanding in what ways files can be hidden and obscured is crucial. Also, understanding basic linux is important, as a multitude of tools are specifically for bash.

##Sources/See More
In the context of CTFs steganography usually involves finding the hints or flags that have been hidden with steganography. Most commonly a media file will be given as a task with no further instructions, and the participants have to be able to uncover the message that has been encoded in the media.

##More

[Steganography](https://en.wikipedia.org/wiki/Steganography)

0 comments on commit cbe02fc

Please sign in to comment.