Cryptography
Encryption: The Language of Security
www.digitalsafezm.com
Table of content
• Definition & Introduction
• Brief Origin of Cryptography
• Types of Cryptography
Challenges
• Methods and Tools
• Demo
Definition &
Introduction
Definition of
Cryptography
Cryptography is an art of securing
information so that only the intended
recipient can understand it.
In simple terms, it’s about hiding
messages from prying eyes making sure
that even if someone intercepts a
message, they can’t make sense of it.
Crypto" means hidden or secret. "Graphy"
means writing. So, cryptography literally
means "secret writing
Brief Origin of
Cryptography
Cryptography has been around for
thousands of years, long before
computers existed. People have always
needed to protect information, whether it
was military orders, political secrets, or
even love letters.
Some famous origins:
• Ancient Egypt (1900 BC)
• Spartan Scytale (700 BC)
• Caesar Cipher (Roman Empire, 50 BC)
• World War II – Enigma Machine
Types of
Cryptography
Challenges
Classical Ciphers
Classical ciphers are the old-school methods of Example
encryption used before modern computers Suppose you’re given this encrypted word: MJQQT
existed. They were designed to disguise text so
only someone who knew the secret method or If you know it’s a Caesar Cipher with a shift of 5, you
key could read it. move each letter back by 5 positions:
• M→H
In CTFs, these challenges test your ability to
recognize and break historical encryption • J→E
schemes. • Q→L
Two of the most common ones are: • Q→L
• T→O
1. Caesar Cipher: shifts letters in the alphabet
by a fixed number. So, MJQQT becomes HELLO
2. Vigenère Cipher: uses a keyword to shift In a CTF, solving classical cipher challenges usually
letters in a more complex pattern. reveals a hidden message or flag
Encoding (Not Encryption)
Encoding is about changing the format of data, Example
not protecting it. The purpose is usually to make If you’re given this encoded string: SGVsbG8=
data easy to store, transfer, or process by
computers. Unlike encryption, encoding does not You might recognize it as Base64. When you
involve a secret key anyone who knows the decode it, you get: Hello
format can decode it.
What you might find in a CTF
Common encoding formats you’ll see in CTFs
include: Encoding challenges often hide:
• Base64 • A flag directly (e.g.,
RmxhZ3tjdGZfd2lubmVyfQ==
• Hexadecimal Flag{ctf_winner})
• ASCII • A clue that points you to another cipher (e.g.,
encoded text that, once decoded, turns out to
be Caesar-shifted).
Steganography with Crypto
Steganography is the practice of hiding data Example
inside other files like images, audio, or video so Imagine you’re given a PNG image in a CTF.
that no one even suspects there’s a secret.
When combined with cryptography, the hidden 1. You run a steganography tool (like steghide or
data itself is also encrypted, meaning you first binwalk) and find a hidden text file inside the
need to extract it, then decrypt it. image.
So, unlike pure cryptography (which hides the 2. That text file turns out to be encrypted with
something like RSA.
meaning), steganography hides the existence
of the message in the first place. 3. Once you decrypt it (using a provided password,
weak key, or another clue), you reveal the secret
message.
What you might find in a CTF
• A flag hidden inside an image or audio file,
revealed after decryption.
• A clue that leads you to the next stage of the
challenge (e.g., a password or key).
• Multi-layer puzzles where you need to both extract
and decrypt the hidden data.
Hash Cracking
A hash is a one-way function that turns any Example
input (like a password or file) into a fixed-size
string of characters. Examples include MD5, Suppose you’re given the following MD5 hash:
SHA-1, and SHA-256.Hashes are not meant to 5f4dcc3b5aa765d61d8327deb882cf99
be reversible. If you search for this hash in a hash database
Once you hash something, you can’t directly (or use a cracking tool like hashcat), you’ll find
get the original input back. But in CTFs, the it corresponds to: password
challenge is often to crack weak or common
hashes by:
• Guessing likely inputs (dictionary What you might find in a CTF
attacks). • A flag revealed as the original plaintext (e.g.,
• Using brute force. Flag{password123}).
• Looking up the hash in pre- • A password to unlock another part of the
computed databases (called challenge.
rainbow tables). • A clue hidden in a cracked hash that points
you to the next step.
Methods and
Tools
In Capture the Flag (CTF) cryptography challenges, the key to solving problems is knowing the right
methods and tools. Each type of challenge whether it’s classical ciphers, modern encryption, or
steganography requires a slightly different approach. By learning to recognize the patterns and
applying the right tools, you can quickly turn confusing text or files into meaningful answers.
The following are some of the tools you’ll need to use in cryptography CTF challenges
Classical Cipher Decryption tools Encoding and Decoding tools
➢ dCode.fr ➢ CyberChef
➢ Cryptii ➢ Online converters like
base64decode.org
Steganography with Crypto tools
Hash Cracking tools
➢ Steghide
➢ CrackStation
➢ ExifTool
➢ Hashcat
Resources for Further Learning…
▪ TryHackMe Cryptography Path: https://tryhackme.com/path/outline/cryptography
▪ CryptoHack: https://cryptohack.org/
▪ OverTheWire Wargames (Krypton): http://overthewire.org/wargames/krypton/
▪ CTF101 Cryptography Guide: https://ctf101.org/cryptography/overview/
▪ dCode Cryptography Tools: https://www.dcode.fr/en
THANK YOU
HAPPY HACKING
www.digitalsafezm.com Digital safe limited