Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PUF Security Analysis Toolkit

A high-performance Python toolkit for evaluating the security and statistical properties of Physically Unclonable Functions (PUFs). This repository processes simulated PUF challenge-response pairs (CRPs) and computes core cryptographic metrics using highly optimized, vectorized linear algebra to handle large datasets efficiently.

Features

  • Vectorized Metric Calculations: Bypasses slow Python loops using C-backed NumPy dot products and broadcasting to instantly calculate fractional Hamming Distances across hundreds of thousands of bit pairs.
  • Academic-Grade Visualizations: Uses matplotlib to generate dark-themed, publication-ready distribution plots and diagnostic heatmaps.
  • Comprehensive Security Metrics:
    • Uniformity: Evaluates the 0/1 balance of individual device responses.
    • Diffuseness: Measures the intra-device response variation across different challenges.
    • Uniqueness (Inter-HD): Calculates the population-level variation between different hardware instantiations.
    • Reliability (Native Error Rate): Compares noisy measurements against a majority-voted "golden response" baseline to assess environmental stability.
    • Pearson Correlation: Extracts bit-aliasing and structural dependencies, outputting histograms, hotspot heatmaps, and a tabular list of the worst-case correlated pairs.

Device Analysis: Board 0

1. Statistical Summary

This section evaluates the primary cryptographic properties of Board 0 against the ideal 0.50 nominal targets for entropy and the 0.00 target for native bit-flip errors.

  • Uniformity (μ / σ): 0.4864 / 0.0390
  • Diffuseness (μ / σ): 0.4988 / 0.0313
  • Reliability/BER (μ / σ): 0.0495 / 0.0128
  • Global Uniqueness (Inter-HD): [Insert Global Mean]

2. Metric Distributions

The discrete distributions below map the fractional Hamming Distances across the challenge-response dataset.

Discrete Metric Distributions for Board 0

Diagnostic Observations:

  • Entropy & Variation: Excellent base entropy. Both Uniformity (0.486) and Diffuseness (0.498) form tight Gaussian curves centered near the 0.50 ideal with very low variance ($\sigma < 0.04$). This indicates optimal 0/1 bias and strong intra-device avalanche characteristics across the CRP space.
  • Stability: The raw Reliability/BER sits at ~4.95%. While healthy for raw silicon subjected to thermal/voltage noise, this baseline mandates a standard Fuzzy Extractor (e.g., using BCH/Reed-Solomon ECC) to correct the 5% drift and achieve the absolute $BER = 0$ required for cryptographic key derivation.

3. Spatial Dependencies and Bit Aliasing

To identify deterministic routing artifacts or physical silicon biases, we evaluate the 256x256 bitwise Pearson correlation matrix.

Pearson Correlation Diagnostics for Board 0

Top Correlated Bit Pairs

The table below highlights the most severe linear dependencies found within the PUF's internal array, extracted from the threshold analysis.

Bit A Bit B Pearson Correlation (r)
23 53 0.2230
65 111 0.1411
11 206 -0.1366
14 226 -0.1301
68 199 0.1259

Diagnostic Observations:

  • Histogram Analysis: The correlation distribution is highly localized at $r = 0.0$, mathematically proving that the vast majority of the 65,536 cross-bit interactions are cryptographically independent.
  • Hotspot Evaluation: The hardware demonstrates virtually zero deterministic routing bias. Only a single bit pair (23, 53) barely breaches the standard $|r| > 0.2$ noise threshold, indicating the physical IC layout is free of systematic logic gate coupling or severe localized thermal hotspots.

Project Structure

├── main.py                 # Core evaluation, mathematical logic, and plotting engine
├── Makefile                # Automation commands for dependency management and execution
├── requirements.txt        # Python dependencies (numpy, pandas, matplotlib)
├── devs/                   # Local storage for compressed PUF CRP datasets (.npz)
└── all_plots/              # Generated visualizations
    ├── discrete/           # Distribution curves for Uniformity, Diffuseness, Uniqueness, Reliability
    └── heatmaps/           # Pearson correlation hotspot matrices and histograms

Installation

This project uses uv for lightning-fast virtual environment and dependency management to prevent library conflicts.

  1. Clone the repository:
    git clone [https://github.com/SaifoSaeed/PUF-Analysis.git](https://github.com/SaifoSaeed/PUF-Analysis.git)
    cd PUF-Analysis
  2. Install dependencies via the included Makefile:
make deps

Note: This will install numpy, pandas, and matplotlib inside your active environment.

Usage

To run the complete analysis suite, simply execute:

make run

Execution Pipeline

When executed, the script will:

  1. Load the pre-simulated challenge-response pairs from the devs/ directory.
  2. Aggregate the raw, noisy measurements into stable golden responses.
  3. Compute the population-level Uniqueness distribution.
  4. Iterate through each device to compute Uniformity, Diffuseness, and Reliability distributions, overlaying them onto single comprehensive graphs saved in all_plots/discrete/.
  5. Perform a 256x256 bitwise Pearson correlation for each device.
  6. Generate hotspot heatmaps (masking standard noise |r| < 0.2) and save them to all_plots/heatmaps/.
  7. Export a final statistical summary table to the console and save the top 20 worst-correlated bit pairs to top_correlated_bits.csv.

Data Pipeline Notes

  • Baselines: Reliability metrics are calculated against an aggregated (majority-voted) golden response rather than a single noisy measurement, ensuring a mathematically robust Native Error Rate evaluation.
  • Optimization: Inter-Hamming Distances and correlation matrices avoid nested loops entirely. Correlation uses np.corrcoef to push the matrix covariance math directly to the CPU's BLAS/LAPACK libraries.

About

PUF Primitive Metric Analysis using dataset of multiple PUF instances.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages