Cryptography
The mathematical foundations of digital security. Understand hash functions, encryption algorithms, encoding standards, and the cryptographic primitives that protect data worldwide.
What is Cryptography?
Cryptography is the science of securing communication and data in the presence of adversaries. From the Caesar cipher used by Roman generals to the elliptic curve algorithms protecting modern web traffic, cryptography has evolved into the invisible infrastructure of digital trust.
At its core, cryptography provides three guarantees: confidentiality (only authorized parties can read the data), integrity (the data has not been tampered with), and authenticity (the data comes from who it claims to come from). Every HTTPS connection, password hash, digital signature, and encrypted message relies on these principles.
Modern cryptography is built on well-studied mathematical problems that are easy to compute in one direction but computationally infeasible to reverse — such as factoring large prime numbers, computing discrete logarithms, or finding hash preimages.
Symmetric vs Asymmetric Encryption
One Key, Two Operations
Symmetric encryption uses the same key for both encryption and decryption. Algorithms like AES-256-GCM and ChaCha20-Poly1305 are extremely fast and widely used for bulk data encryption. The challenge is securely sharing the key between parties.
Public-Private Key Pair
Asymmetric encryption uses a mathematically linked key pair: a public key for encryption and a private key for decryption. RSA and Ed25519 solve the key distribution problem but are slower than symmetric encryption. Typically used to exchange symmetric keys.
Hash Functions
A hash function takes arbitrary-length input and produces a fixed-size output (the "digest" or "hash"). Cryptographic hash functions have three critical properties: preimage resistance (you cannot reverse the hash), second preimage resistance (you cannot find a different input with the same hash), and collision resistance (you cannot find any two inputs with the same hash).
SHA-2 Family
SHA-256 and SHA-512 are the current standard. Used in Bitcoin, TLS, digital signatures, and data integrity. Considered secure against all known attacks.
HMAC
Hash-based Message Authentication Code combines a hash function with a secret key to verify both integrity and authenticity of a message.
MD5 (Legacy)
Broken since 2004 — collisions can be generated in seconds. Only suitable for non-security checksums. Never use for password hashing or digital signatures.
Encoding Standards
Encoding is not encryption — it is a way to represent data in a different format. Encoding is reversible and does not require a key. These standards are essential for data interchange between systems.
Base64
Converts binary data to ASCII text using 64 characters. Used in email, data URLs, and embedding binary data in JSON.
URL Encoding
Encodes special characters in URLs using percent-encoding (%20 for space, %2F for slash). Essential for query parameters and form data.
UUID / NanoID / ULID
Unique identifiers for database keys, API tokens, and session management. Each format has different trade-offs in size, randomness, and sortability.
Essential Cryptography Tools
Hash, encode, decode, and generate identifiers — all running locally in your browser.
SHA-256 Generator
Compute SHA-256 hashes for strings and files with HMAC support.
HashMD5 Generator
Generate MD5 hashes for file checksums and legacy system compatibility.
AnalyzerHash Identifier
Identify the hash algorithm from any hash string by length and pattern.
UtilityHMAC Generator
Create Hash-based Message Authentication Codes for API signing and verification.
EncodingBase64 Converter
Encode and decode Base64 strings with file upload support.
EncodingURL Encoder
Percent-encode URLs and query parameters for safe HTTP transmission.
UtilityJWT Decoder
Decode and inspect JSON Web Tokens without sending data to any server.
ToolkitEncoding Utilities
Multi-format encoding and decoding toolkit for binary, hex, and text conversions.
IdentifierUUID Generator
Generate v4 random UUIDs for database keys and API identifiers.
IdentifierNanoID Generator
Compact URL-friendly unique IDs with configurable alphabet and length.
IdentifierULID Generator
Time-sortable unique identifiers with millisecond precision.
RandomRandom Bytes Generator
Generate cryptographically secure random bytes in hex, Base64, or raw format.
Featured Articles
Hash Functions Explained
SHA, MD5, HMAC, and bcrypt: how cryptographic hash functions work and when to use each.
Read more → ComparisonEncryption Algorithms Compared
AES vs ChaCha20, RSA vs Ed25519: performance benchmarks and security analysis.
Read more → TutorialUnderstanding Base64 Encoding
Why Base64 exists, how it works, and common use cases in web development and APIs.
Read more → ComparisonUUID v4 vs NanoID vs ULID
Choosing the right unique identifier for your project: size, randomness, sortability, and performance.
Read more → SecurityJWT Security Best Practices
Common JWT vulnerabilities, algorithm confusion attacks, and how to implement tokens safely.
Read more → TutorialHMAC for API Security
How to use HMAC signatures to verify API request integrity and authenticate webhooks.
Read more →Algorithm Comparison Table
| Algorithm | Type | Output Size | Use Case | Status |
|---|---|---|---|---|
| SHA-256 | Hash | 256 bits | Data integrity, signatures, Bitcoin | Secure |
| SHA-512 | Hash | 512 bits | High-security integrity verification | Secure |
| MD5 | Hash | 128 bits | Non-security checksums only | Broken |
| AES-256-GCM | Symmetric | 256-bit key | Bulk data encryption, TLS, disk encryption | Secure |
| ChaCha20-Poly1305 | Symmetric | 256-bit key | Mobile/embedded encryption, TLS 1.3 | Secure |
| RSA-2048 | Asymmetric | 2048-bit key | Key exchange, digital signatures | Secure |
| Ed25519 | Asymmetric | 256-bit key | SSH keys, modern signatures, faster than RSA | Secure |
| HMAC-SHA256 | MAC | 256 bits | API authentication, webhook verification | Secure |
Frequently Asked Questions
What is cryptography? ▾
What is the difference between encryption and hashing? ▾
Is MD5 secure for password hashing? ▾
What is SHA-256? ▾
What is Base64 encoding? ▾
What is the difference between symmetric and asymmetric encryption? ▾
What is a UUID? ▾
Related Topics
Password Security
Password generation, strength analysis, breach detection, and credential management best practices.
CategoryAuthentication Security
MFA, passkeys, biometrics, and the future of identity verification beyond passwords.
CategoryOnline Privacy
Protecting personal data, browser fingerprinting, tracking prevention, and privacy tools.
CategoryOnline Safety
Comprehensive digital safety covering phishing, malware, social engineering, and identity theft prevention.
GeneratePass Editorial Team
Verified AuthorThe GeneratePass Editorial Team is comprised of security researchers, cryptography enthusiasts, and software engineers dedicated to making browser-based cryptographic tools accessible and secure. We write guides with a focus on local execution, zero-trust patterns, and client-side data sovereignty.