Skip to content

Security Lab

The credential-handling discipline: passwords, tokens, hashes, and encryption, treated as one connected problem.

Runs entirely in your browser

This tool executes locally using standard browser APIs (for example window.crypto.getRandomValues or crypto.subtle where applicable). Your input is not transmitted to or stored on a ScriptPulse server. See How Calculations Work.

No data uploaded

Overview

Security Lab is this site's original, most mature category, and the only one with full topical-hub coverage across all three of its natural sub-disciplines (authentication, encryption, hashing). Its 14 tools cover the practical mechanics a working engineer touches constantly: generating and analyzing passwords, inspecting and building JSON Web Tokens, computing cryptographic hashes and HMACs, generating unique identifiers, and encrypting or decrypting data locally in the browser.

What ties these 14 tools together as one discipline, rather than a loose grab-bag, is that they all sit somewhere on the path from 'a user proves who they are' to 'that proof is stored, transmitted, and verified safely.' A password is generated, then hashed for storage, not encrypted — a distinction this category's own hubs treat as a hard boundary, not a stylistic choice. A session is established, then represented as a token (a JWT) or a server-side cookie. A payload needs confidentiality, which is encryption's job, distinct from integrity, which is hashing's and HMAC's job.

Why Security Lab Matters

Nearly every application has to solve credential handling once, and getting it wrong has asymmetric consequences: a broken authentication scheme, a weak password-hashing choice, or a leaked signing key doesn't degrade gracefully — it's usually the direct cause of a breach disclosure, not a performance footnote. This category exists because these decisions (which hash function, which token format, which encryption mode) are made once, early, and are expensive to unwind later, which makes getting oriented quickly worth real time investment up front.

Common Workflows

  • Generating a strong password or passphrase, then immediately checking its composition and entropy with the Password Analyzer before using it anywhere real.
  • Building a JWT with the JWT Generator, decoding it with the JWT Inspector to confirm the claims are exactly as intended, then testing an edge case (an expired or tampered token) with the JWT Claims Editor.
  • Computing a file or payload's hash with the Hash Generator to verify integrity, or an HMAC with the HMAC Generator when the value also needs to prove it came from a party holding a shared secret.
  • Generating a UUID, ULID, or NanoID for a new resource identifier, choosing between them based on whether sort-order or compactness actually matters for that specific use case.
  • Encrypting a test payload with the Encryption Studio to confirm a symmetric or asymmetric scheme behaves as expected before wiring it into real application code.

Learning Roadmap: Beginner

  • Start with the distinction between hashing (one-way, for passwords and integrity) and encryption (reversible, for confidentiality) — conflating the two is the single most common beginner mistake in this category.
  • Generate and inspect a JWT end to end (Generator → Inspector) to see concretely that a token's payload is only encoded, not encrypted, and therefore readable by anyone who has it.
  • Read the Authentication & Tokens Lab hub's Core Concepts section before writing any real login flow — it covers the credential-storage and session-token fundamentals this category's tools implement.

Learning Roadmap: Professional

  • Study the topic-ownership boundaries the Authentication, Encryption, and Hashing hubs document explicitly — knowing precisely which hub owns which sub-concept (password hashing vs. general hashing vs. confidentiality) prevents re-deriving the same decision inconsistently across a codebase.
  • Work through the Bcrypt vs Argon2, AES-128 vs AES-256, and RSA vs ECC comparisons before finalizing an algorithm choice for a new system — each names the specific tradeoffs a generic best-practices checklist glosses over.
  • Treat every algorithm and parameter choice in this category as something to revisit periodically against current guidance (NIST, OWASP), not a one-time decision — cryptographic recommendations shift as computing power and cryptanalysis both advance.

Tool Selection Strategy

  • Start from the question you're actually answering, not the tool name: 'does this need to be recovered later' points to encryption; 'does this only need to be verified, never recovered' points to hashing; 'does this need to prove who sent it, not just that it's unmodified' points to HMAC or a digital signature rather than a plain hash.
  • For password-adjacent work specifically, always reach for the dedicated slow, memory-hard functions (Bcrypt Hasher, and Argon2 via the Encryption Studio's key-derivation support) rather than the general-purpose Hash Generator — a fast hash is the wrong tool for anything an attacker might try to brute-force offline.
  • When choosing between UUID, ULID, and NanoID for a new identifier, decide first whether database insert-order matters (favoring ULID) or compactness for a public URL matters (favoring NanoID) — defaulting to UUID without checking either is the most common unexamined choice in this category.

Tools in Security Lab

Developer Guide

Go deeper than the tool list — these Developer Hubs cover the concepts behind Security Lab's tools in full depth.

Comparative Guides

Decide between the technologies and formats Security Lab's tools work with:

Bcrypt vs Argon2

Stashing passwords safely requires a special class of cryptographic functions: slow, resource-intensive hashing algorithms. Unlike fast, general-purpose hashes like MD5, SHA-1, or SHA-256 (which are designed to process megabytes of file data in milliseconds), password hashing algorithms are intentionally throttled to delay brute-force cracking attempts. For over two decades, Bcrypt has been the standard recommendation for securing user databases. However, the emergence of Argon2—the winner of the Password Hashing Competition (PHC)—has changed the security landscape. This guide compares Bcrypt and Argon2 across algorithm safety, hardware resistance, and configuration details.

Read Guide

JWT vs Session Cookies

The real decision here isn't 'which is more secure' — it's which failure mode you'd rather manage: session cookies push complexity into server-side state and database lookups, while JWTs push it into the much harder problem of revoking a credential that was designed specifically not to need a server round-trip to validate.

Read Guide

OAuth2 vs SAML

OAuth2 and SAML solve overlapping but distinct problems — OAuth2 is fundamentally an authorization framework for granting API access, while SAML is purpose-built for enterprise single sign-on — and the confusion between them is compounded by the fact that OAuth2 alone doesn't actually authenticate anyone at all; that requires OpenID Connect layered on top.

Read Guide

UUID vs ULID vs NanoID

Generating unique identifiers is a foundational task in software development, whether you are seeding database primary keys, generating session tokens, or routing API endpoints. For decades, the standard choice has been UUIDs, particularly UUID v4. However, modern application demands have highlighted two notable limitations of UUID v4: random indexes fragment B-Tree structures in databases, and the 36-character length is verbose for client-facing URLs. This deep dive compares standard UUIDs, lexicographically sortable ULIDs, and lightweight, customizable NanoIDs across performance, collision risk, and indexing efficiency.

Read Guide

AES-128 vs AES-256

AES-128 and AES-256 are the same cipher family, differing only in key size and the number of internal transformation rounds — but that difference has real, concrete consequences for performance, quantum-era risk margins, and which compliance frameworks will actually accept which one.

Read Guide

RSA vs ECC

RSA and ECC solve the same problem — asymmetric encryption and digital signatures without a shared secret — using entirely different mathematics, and the practical consequence is dramatic: an ECC key achieves the same security level as an RSA key at a small fraction of the size, which is why ECC has become the default for new protocols despite RSA's much longer track record.

Read Guide

SHA256 vs SHA512

Cryptographic hash functions are designed to ingest arbitrary binary inputs and return a fixed-size, deterministic byte sequence called a digest. These functions must be one-way (infeasible to reverse-engineer) and collision-resistant (highly unlikely that two distinct inputs produce the same hash). In modern cryptography, the SHA-2 (Secure Hash Algorithm 2) family is the default choice for data integrity, SSL/TLS certificates, and blockchain networks. Within this family, SHA-256 and SHA-512 are the two most prominent algorithms. Surprisingly, their differences extend beyond digest length to internal block sizes, math architectures, and hardware parsing performance. This guide compares SHA-256 and SHA-512 in detail.

Read Guide

Bcrypt vs Scrypt

Bcrypt and Scrypt both slow down password verification deliberately, but they do it in fundamentally different ways: Bcrypt spends CPU cycles alone, while Scrypt deliberately consumes large amounts of memory alongside CPU time. That single architectural difference — memory-hardness — is the whole reason Scrypt exists, and it's the lens this comparison uses throughout.

Read Guide

MD5 vs SHA1 vs SHA256

MD5 and SHA-1 are both cryptographically broken — not theoretically weak, but practically broken, with real, demonstrated attacks — while SHA-256 remains secure with no known practical attack. This comparison is less about a tradeoff between three roughly-equivalent options and more about understanding exactly why two of them were retired and what, if anything, they're still safe to use for.

Read Guide

HMAC vs Digital Signatures

Both HMAC and digital signatures let a recipient verify a message wasn't tampered with, but they answer a different second question: HMAC only proves the message came from someone who holds a shared secret, while a digital signature proves it came from the one specific party holding a private key — and only the second property, non-repudiation, actually holds up if the sender later denies sending it.

Read Guide

Argon2 vs Scrypt

Argon2 and Scrypt are both memory-hard — the defining property that separates them from Bcrypt (see Bcrypt vs Scrypt) — but Argon2 refines the idea with a hybrid access pattern specifically designed to resist both GPU cracking and side-channel timing attacks simultaneously, something plain Scrypt's single access pattern can't do at once.

Read Guide

Common Mistakes

  • Encrypting a password for storage instead of hashing it — encryption is reversible by design, which is exactly the property you don't want for a stored credential.
  • Putting sensitive data directly in a JWT payload, forgetting that the payload is only base64url-encoded, not encrypted, and fully readable by anyone who has the token.
  • Using a fast, general-purpose hash function (like plain SHA-256) for password storage instead of a dedicated slow, memory-hard function — speed is the wrong property to optimize for here.
  • Reusing the same signing secret or key across multiple environments or services, so that a single leak compromises everything relying on that key at once.

Standards Landscape

  • NIST SP 800-63B governs modern digital-identity and password-composition guidance, including the now-standard advice against mandatory periodic password rotation.
  • RFC 7519 (JWT), RFC 7515 (JWS), and RFC 7516 (JWE) define the token formats this category's JWT tools implement.
  • RFC 9106 defines Argon2, the current recommended password-hashing algorithm; FIPS 197 defines AES, the standard symmetric cipher this category's encryption tools use.

Glossary

Hashing
A one-way transformation of data into a fixed-size digest; the same input always produces the same output, but the output cannot be reversed back into the input.
Encryption
A reversible transformation of data that requires a key to decrypt back to the original — used for confidentiality, unlike hashing.
HMAC
A keyed hash construction that proves both integrity and that the sender held a specific shared secret, distinct from a plain unkeyed hash.
Salt
Random data mixed into a password before hashing, ensuring identical passwords produce different hashes and defeating precomputed lookup-table attacks.
Memory-hard function
A hashing algorithm (like Argon2 or scrypt) deliberately designed to require significant memory, not just CPU time, to compute — raising the cost of parallel cracking hardware.
JWT (JSON Web Token)
A compact, signed token format for representing claims between two parties, commonly used for stateless session authentication.
Non-repudiation
The property that a specific party, and only that party, could have produced a given signature — provided by asymmetric digital signatures, not by symmetric HMACs.

Troubleshooting

  • If a hashed password never matches on verification, check whether the salt is being stored and reused correctly — a mismatched or regenerated salt produces a different hash even for the identical password.
  • If a JWT fails signature verification unexpectedly, confirm both sides are using the exact same algorithm and secret/key — a token signed with HS256 will never verify against an RS256 configuration, regardless of whether the claims are otherwise correct.
  • If an encrypted value can't be decrypted, verify the exact key, initialization vector, and cipher mode all match between encryption and decryption — a single mismatched parameter produces garbage output, not a clear error, in many implementations.

References

Frequently Asked Questions

What is the difference between hashing and encryption?
Hashing is one-way and irreversible — used to verify data (like a password) without ever needing to recover the original. Encryption is reversible with the correct key — used when the original data needs to be recovered later. Passwords should always be hashed, never encrypted.
Which hub should I read for authentication versus general-purpose hashing?
The Authentication & Tokens Lab hub owns password hashing (as credential storage), session tokens, and login workflows. The Hashing & Integrity hub owns general-purpose hashing, checksums, and HMAC unrelated to authentication specifically.
Should I use UUID, ULID, or NanoID for a new identifier?
Use ULID if database insert-order and sortability matter at scale. Use NanoID if you need the shortest identifier for a public-facing URL. Use UUIDv4 as a safe, universally-supported default if neither specific property matters.
Is it safe to generate real production passwords or keys using these browser tools?
The tools run entirely client-side with no network transmission, which is safe for the computation itself, but treat any value you generate and then paste elsewhere (into a form, a chat, a shared document) as no longer confidential from that point on.
Why does this category have full hub coverage when others don't?
Security Lab's 14 tools map cleanly onto three coherent sub-disciplines (authentication, encryption, hashing), each of which earned its own dedicated hub in Milestone 1 — the site's very first hub-expansion pass, which is why this category was the first to reach complete topical coverage.
What is the difference between a JWT and a session cookie?
A JWT carries its session claims inside the token itself and can be verified without a database lookup; a session cookie holds only an opaque ID that must be checked against server-side storage. See the JWT vs Session Cookies comparison for the full tradeoff.
Why shouldn't I use SHA-256 directly for password storage?
SHA-256 is a fast, general-purpose hash — deliberately fast, which is exactly the wrong property for password storage, since it lets an attacker with a stolen database try billions of guesses per second. Use a dedicated slow, memory-hard function like Argon2id or Bcrypt instead.
What does "memory-hard" mean and why does it matter for passwords?
A memory-hard function requires significant RAM, not just CPU time, to compute — this makes building cheap, massively-parallel cracking hardware (GPUs, ASICs) much more expensive for an attacker, compared to a purely CPU-bound function like older Bcrypt.

Related Categories

Other categories whose tools share a Developer Hub with Security Lab: