SShortSingh.
Back to feed

Why Math.random() Passwords Are Crackable and What Developers Should Use Instead

0
·3 views

A developer describes how a password reset flow built on Math.random() was broken by a penetration tester, who reconstructed the generator's internal state from two consecutive outputs. The article explains that V8's xorshift128+ is a deterministic pseudorandom generator, not a secure one, so its outputs can be predicted. It recommends drawing randomness from the operating system's cryptographically secure source instead, such as Python's secrets module and Node's crypto.randomInt(). Sample code in both languages demonstrates generating 16-character passwords with roughly 95 bits of entropy. The author also notes that for quick one-off credentials, reputable online generators are a practical alternative to writing code.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Builds AP Agent With Hindsight Memory That Learns When to Escalate

An accounts-payable desk typically resolves recurring invoice exceptions, such as a monthly steel price adjustment, by checking the contract and approving the charge each time. The author built Ledgerwise, which uses deterministic matching to find discrepancies and an agent to decide them based on how similar exceptions were resolved before. Early versions that simply approved whatever memory suggested failed on a large fuel surcharge that exceeded the contractual cap, prompting a redesign around whether memory is sufficient for a given case. The agent now stores each human decision along with the reason and magnitude, using Hindsight, an open-source agent memory system from Vectorize. The system auto-resolves when precedent is consistent and otherwise escalates with the relevant prior decisions attached.

0
ProgrammingDEV Community ·

Meta Acquires Conductor as GitHub Details Infrastructure for AI Coding Agents

Meta has acquired Conductor, a startup whose tools let developers coordinate several AI coding agents working in parallel workspaces. The approach splits work such as frontend, backend, testing, and documentation across agents rather than relying on a single assistant. Separately, GitHub described a new Git storage architecture after internal tests reporting support for 5,000 concurrent agents on one repository and 7,200 pushes per second. These are internal test figures, not evidence of current everyday repository traffic, but they signal expected growth in automated activity. Analysts note that coordinating agents raises challenges such as conflicting changes, shared dependencies, and heavier review workloads.

0
ProgrammingDEV Community ·

Practical Cisco CCNA Lab Guide Covers Essential Router Configuration Basics

A new guide aimed at Cisco CCNA (200-301) candidates argues that hands-on lab practice is essential for turning networking theory into usable skill. It recommends simulation tools such as Cisco Packet Tracer, GNS3, and EVE-NG for building a virtual environment. The walkthrough focuses on the initial configuration steps every engineer should apply to enterprise routers. It begins with securing control-plane access before any traffic is routed, including setting a hostname and an enable secret password.

0
ProgrammingDEV Community ·

Linkit: a free desktop bookmark manager that summarizes and searches saved links by meaning

The developer built Linkit, a free desktop bookmark manager, after finding saved links hard to revisit. Unlike browser bookmarks, which store only a URL, Linkit fetches and summarizes each saved page and extracts key takeaways. Its search matches on meaning via embeddings, so queries don't need the exact wording, and a knowledge graph visualizes how saved items connect. The app also offers AI-curated collections, duplicate detection, background link health checks, and periodic curation insights, with support for OpenAI-compatible APIs or local models through Ollama. Recent updates add interface scaling tied to the system display, safer storage switching, and rollback-capable import and export.