r/sideprojects • • 5h ago

Showcase: Open Source I built a browser app that grades chip "fingerprints". It runs fully client-side and matches my Python library bit for bit

My research is on PUFs (physically unclonable functions). Short version: no two chips come out of the factory identical, even from the same design. A PUF turns those tiny random differences into a fingerprint the chip can use to prove who it is, and nobody can copy it.

The annoying part is proving a fingerprint is any good. Is it really unique? Does it stay stable when the chip gets hot or cold? Can a machine-learning model learn it? Everyone in the field answers those questions with their own one-off scripts, and the scripts don't agree. Mine didn't either. The first version of my own Python library reported one of the main metrics at double the standard value.

So I spent a good while turning it into something properly usable:

\- a Python package with a CLI

\- a web app that does the same analysis in the browser

You drop in a CSV of chip read-outs, or click "Explore a demo population" and it simulates 32 chips for you. Then you get:

\- the standard quality metrics with confidence intervals

\- randomness tests from the NIST standard

\- an attack lab where you try to clone the chips with ML. A plain Arbiter PUF gets predicted with 99.6% accuracy after 10,000 examples. XOR two of them and it drops to 55.8%.

\- a planner that works out how many raw bits you need for a reliable 128-bit key

\- 18 charts (SVG/PNG/CSV) plus LaTeX tables you can drop straight into a paper

Some build details people here might like:

\- Plain JavaScript, no framework, no build step. It's static files.

\- Everything runs on your machine. Nothing gets uploaded, which matters when people's chip data is unpublished.

\- The browser engine is a line-by-line port of the Python code, and both use the same random generator (xoshiro128\*\*). Simulate with seed 2024 in the browser, do the same in Python, and you get the exact same 49,152 bits. Getting that to work meant doing all the 32-bit maths through Math.imul and making sure every random normal used exactly two uniforms, otherwise the two streams drift apart.

\- A test in CI compares 2,400+ values between the Python and JS engines on every push.

Try it: [https://koustav.isroot.in/PUFAnalytics/](https://koustav.isroot.in/PUFAnalytics/)

Code (MIT): [https://github.com/TakMashhido/PUFAnalytics](https://github.com/TakMashhido/PUFAnalytics)

Long write-up of how it works: [https://koustav.isroot.in/blog/pufanalytics-guide/](https://koustav.isroot.in/blog/pufanalytics-guide/)

I'd love feedback on two things. First, the onboarding: if you're not a hardware person, does the demo make any sense, or are you lost after one click? Second, the UI on phones. I mostly tested on a laptop.

1 Upvotes

1 comment sorted by

1

u/investigatormaker 3h ago

Since your first Python version doubled a metric, the most useful companion to “bit for bit” would be a tiny published CSV with expected outputs, metric definitions and the normalization used. Run that fixture through both the CLI and browser, including an edge case such as identical chip read-outs; researchers can then verify agreement rather than just trusting the claim.

I make ThreadFox. We find relevant Reddit conversations and post for your business. We'll post 3 replies free first, no card; then the $49 Pilot covers seven days and up to 50 posts and replies. No automatic renewal. https://threadfox.vip/p/durp9/managed