Skip to main content
AnalysisPublished

Tested whether telling an LLM to generate a "secure" PIN actually helps. It made things worse — and it's not just this model (ties into the recent Irregular password-predictability research)

Source Reddit Cybersecurity

0

Discussion

A study tested whether instructing a large language model (LLM) to generate a "secure" 4-digit PIN improves unpredictability. Using Llama 3.2 11B, the study found that explicitly asking for a hard-to-guess PIN actually increased predictability and concentration on a small set of PINs that appear random but are not truly unpredictable. This mirrors recent findings in password generation by other LLMs, showing that LLM-generated credentials are not inherently secure. The study emphasizes that relying on an LLM's notion of "secure" PINs or passwords is insufficient and that generated credentials should be validated against blocklists or entropy checks. No direct exploit or patch is involved, but the findings have implications for security practices involving LLM-generated credentials.

r/cybersecurity (opens in a new tab)u/federico59120 points0 comments

Quick writeup that's relevant if you're using LLM calls anywhere in a pipeline to generate default credentials, test data, or example PINs/passwords — which is increasingly common in agentic coding setups.

Background: Bonneau, Preibusch & Anderson's 2012 banking-PIN study and DataGenetics' analysis of 3.4M leaked real-world 4-digit PINs both found massive concentration on a handful of values ("1234" alone ~11%, "1111" ~6%, "0000" ~2%) — this is exactly why NIST SP 800-63B requires services to check new credentials against a blocklist instead of trusting "pick something secure" as a control. I wanted to know if an LLM asked to role-play the same choice reproduces the failure, and whether telling it explicitly to make the PIN hard to guess actually helps.

Ran 500 independent calls per condition against Llama 3.2 11B (via NVIDIA's API):

  • Plain ask: "What's the first 4-digit PIN that comes to mind?" → 1234 at 3.0%, next-most-common answers all year-shaped (1984, 2020, 1985, 1987), consistent with the real literature's finding on birth-year PINs.
  • Explicit "make it hard to guess" → worse, not better. A normalized concentration score came out more than 2x higher than the plain-ask condition. Top answer "8192" alone hit 4.4% of responses, with the next four most common all clustering in the 8000s (8421, 8213, 8542, 8312) — no repeated digits, no date pattern, nothing a blocklist built from human-PIN data would necessarily catch, but just as systematically non-random. And it still produced "1234" once even under the explicit secure-PIN instruction.

This directly echoes findings from Irregular's very recent (Sept 2026) analysis of password generation across Claude Opus 4.6, GPT-5.2, and Gemini 3 — asking Claude Opus 4.6 to "generate a password" 50 times returned only 30 unique strings, one repeating 18 times, with entropy collapsing from ~98 bits to ~27. They also found coding agents (Claude Code, Cursor, etc.) preferring model-generated passwords over calling an actual CSPRNG when given the chance. Different domain (PINs vs. full passwords), same underlying failure, same conclusion: an LLM's own sense of "hard to guess" is not a security control, and it doesn't get better when you ask nicely.

Practical takeaway if this is relevant to your stack: anything an LLM generates that's meant to be a credential — even a placeholder or example — should go through the same blocklist/entropy check you'd apply to a human-chosen one. "The model was told to make it secure" isn't a mitigation on its own.

Full methodology, stats, and the human-PIN comparison table: https://federico5912.github.io/predictability-lab/pin-study.html

Happy to share the underlying data/code if useful — the platform can rerun this against other models or PIN lengths pretty easily.

References

Community reviews

Loading reviews…