We covered different hashing concepts and its algorithms as well as the goal of hashing. This was part of the web fundamentals pathway from TryHackMe.

Please watch the video at the bottom for full detailed explanation of the walkthrough.

Network Packets Analysis Study Notes

OSCP Study Notes

Basic Terminology of Cryptography & Hashing

Plaintext – Data before encryption or hashing, often text but not always as it could be a photograph or other file instead.

Encoding – This is NOT a form of encryption, just a form of data representation like base64 or hexadecimal. Immediately reversible.

Hash – A hash is the output of a hash function. Hashing can also be used as a verb, “to hash”, meaning to produce the hash value of some data.

Brute force – Attacking cryptography by trying every different password or every different key

Cryptanalysis – Attacking cryptography by finding a weakness in the underlying maths

Definition of Hash Function

Hash functions are quite different from encryption. There is no key, and it’s meant to be impossible (or very very difficult) to go from the output back to the input.

A hash function takes some input data of any size, and creates a summary or “digest” of that data. The output is a fixed size. It’s hard to predict what the output will be for any input and vice versa. Good hashing algorithms will be (relatively) fast to compute, and slow to reverse (Go from output and determine input). Any small change in the input data (even a single bit) should cause a large change in the output.

The output of a hash function is normally raw bytes, which are then encoded. Common encodings for this are base 64 or hexadecimal. Decoding these won’t give you anything useful.

Integrity Checking

Hashing can be used to check that files haven’t been changed. If you put the same data in, you always get the same data out. If even a single bit changes, the hash will change a lot. This means you can use it to check that files haven’t been modified or to make sure that they have downloaded correctly. You can also use hashing to find duplicate files, if two pictures have the same hash then they are the same picture.

HMACs

HMAC is a method of using a cryptographic hashing function to verify the authenticity and integrity of data. The TryHackMe VPN uses HMAC-SHA512 for message authentication, which you can see in the terminal output. A HMAC can be used to ensure that the person who created the HMAC is who they say they are (authenticity), and that the message hasn’t been modified or corrupted (integrity). They use a secret key, and a hashing algorithm in order to produce a hash.

Goals of Cryptography

Security practitioners use cryptographic systems to meet four fundamental goals: confidentiality, integrity, authentication, and nonrepudiation.

Terminology

Plaintext
Before a message is put into a coded form, it is known as a plaintext message and is represented by the letter P when encryption functions are described.
Ciphertext
The sender of a message uses a cryptographic algorithm to encrypt the plaintext message and produce a ciphertext message, represented by the letter C.
Keys
All cryptographic algorithms rely on keys to maintain their security. For the most part, a key is nothing more than a number. It’s usually a very large binary number, but it’s a number nonetheless.
Key-space
Every algorithm has a specific key space. The key space is the range of values that are valid for use as a key for a specific algorithm.


A key space is defined by its bit size. Bit size is nothing more than the number of binary bits (0s and 1s) in the key. The key space is the range between the key that has all 0s and the key that has all 1s. Or to state it another way, the key space is the range of numbers from 0 to 2n, where n is the bit size of the key.
Algorithm
An algorithm is a set of rules, usually mathematical, that dictates how encryption and decryption processes are to take place.
Kerckhoffs’s Principle
Kerckhoffs’s principle is that a cryptographic system should be secure even if everything about the system, except the key, is public knowledge.
Cryptanalysis
The study of methods to defeat codes and ciphers (defeating cryptography).
Cryptology
Together, cryptography and cryptanalysis are commonly referred to as cryptology.
Cryptosystems
Specific implementations of a code or cipher in
hardware and software are known as cryptosystems.

Room Answers | TryHackMe Hashing – Crypto 101

Read the words, and understand the meanings!
Is base64 encryption or encoding?

encoding

What is the output size in bytes of the MD5 hash function?
16

Can you avoid hash collisions? (Yea/Nay)

Nay

If you have an 8 bit hash output, how many possible hashes are there?

256
Crack the hash “d0199f51d2728db6011945145a1b607a” using the rainbow table manually.

basketball

Crack the hash “5b31f93c09ad1d065c0491b764d04933” using online tools

tryhackme

Should you encrypt passwords? Yea/Nay

Nay

How many rounds does sha512crypt ($6$) use by default?

5000

What’s the hashcat example hash (from the website) for Citrix Netscaler hashes?

1765058016a22f1b4e076dccd1c3df4e8e5c0839ccded98ea

How long is a Windows NTLM hash, in characters?

32

Crack this hash: $2a$06$7yoU3Ng8dHTXphAg913cyO6Bjs3K5lBnwq5FJyA6d01pMSrddr1ZGCorrect

85208520

Crack this :hash: 9eb7ee7f551d2f0ac684981bd1f1e2fa4a37590199636753efe614d4db30e8e1

halloween

Crack this hash: $6$GQXVvW4EuM$ehD6jWiMsfNorxy5SINsgdlxmAEl3.yif0/c3NqzGLa0P.S7KRDYjycw5bnYkF5ZtB8wQy8KnskuWQS3Yr1wQ0

spaceman

Bored of this yet? Crack this hash: b6b0d451bbf6fed658659a9e7e5598fe

funforyou

What’s the SHA1 sum for the amd64 Kali 2019.4 ISO? http://old.kali.org/kali-images/kali-2019.4/

186c5227e24ceb60deb711f1bdc34ad9f4718ff9

What’s the hashcat mode number for HMAC-SHA512 (key = $pass)?

1750

FREE Short Course | Log Analysis & Management: Windows & Linux

About the Author

Mastermind Study Notes is a group of talented authors and writers who are experienced and well-versed across different fields. The group is led by, Motasem Hamdan, who is a Cybersecurity content creator and YouTuber.

View Articles