# Insecure PRNG Seed

> Detects cryptographic operations where pseudo-random number generators are seeded with predictable values.

- Skill: `zakirkun/insecure-prng-seed` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/insecure-prng-seed`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/insecure-prng-seed/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/insecure-prng-seed

---


# Insecure PRNG Seed

## Overview
A PRNG seeded with predictable values produces predictable output. Attackers who know or can guess the seed can predict all subsequent random values, including:
- Session tokens and CSRFs
- Password reset tokens
- Cryptographic keys
- Nonces

Common bad seeds: `time()`, `getpid()`, hardcoded integers, zero.

## Remediation
Use OS entropy sources for seeding or use CSPRNGs directly:
- Python: `secrets` module, `os.urandom()`
- Go: `crypto/rand`
- Node.js: `crypto.randomBytes()`
- Java: `SecureRandom()` (default seeding is safe)
- C/C++: `/dev/urandom` or `getrandom()`

