ASCI Logo
ASCI.Academy
LearnPracticeCompeteCareer
Sign InGet Started

Search ASCI Academy

Universal search across Courses, Lessons, Skills, Projects, Challenges, Competitions, Jobs, Internships, and Users

cs50 cybersecurity

Curriculum Index

Current LevelInitiate
0/ 500 XP
Gravit Certificate:
100% Required
  • 1.1 Encoding vs Hashing vs Encryption
  • 1.2 Salted Hashes & Rainbow Table Defense
•
1
2
3
4
5
6
7
8
9
10
Module 1: Securing Accounts — Authentication & Hashing•Lesson 1

1.1 Encoding vs Hashing vs Encryption

### Cryptographic Fundamentals
* **Encoding (e.g. Base64):** Transforms data into alternate character sets for reliable network transport. It provides **zero confidentiality**.
* **Hashing (e.g. SHA-256, bcrypt):** A deterministic, one-way mathematical function. Given input $x$, it produces a fixed-length digest $H(x)$. It is computationally infeasible to invert $H(x)$ back to $x$.
* **Encryption (e.g. AES-256, RSA):** A two-way transformation that secures confidentiality using secret keys.

example.pyPython 3.11
import hashlib
digest = hashlib.sha256(b"admin").hexdigest()
print(f"DIGEST_PREFIX:{digest[:8]}")
Python 3.11
•
Interactive Challenge
+70 XP
Challenge Objective

Compute the hash digest and print 'HASH_COMPUTED'.

solution.py
UTF-84 SpacesAuto-saved
cpython3.11:~/workspace
CPython 3.11.8 (WASM)
$python3 -u solution.py
Click "Compile & Run" (or press Ctrl + Enter) to compile AST, verify bytecode, and execute the solution.