Skip to main content

hwpwn

A user-friendly tool designed to facilitate hardware security attacks. The aim is to provide a simple interface with commands that cover multiple steps typically involved in hardware security attacks. Plus, it makes repeating attacks or changing details very easy, so you can quickly see what happens when you tweak something.

Quickstart

First install the package with pip:

$ pip install hwpwn --user

The hwpwn has multiple commands which can be called in chain, using shell pipe. Alternatively, you can write a flow YAML file which has the commands described in textual format and run the flow with hwpwn client.

Create a dummy data file:

$ cat <<EOF > test.csv
t,a,b,c
1,3,3,4
2,3,4,5
3,9,2,1
EOF

To use in piped commands one can, for example:

$ hwpwn data load test.csv | hwpwn data subtract a b ab --append | cat
{"x_axis": [1.0, 2.0, 3.0], "signals": [{"name": "a", "vector": [3.0, 3.0, 9.0]},
{"name": "b", "vector": [3.0, 4.0, 2.0]}, {"name": "c", "vector": [4.0, 5.0, 1.0]},
{"name": "ab", "vector": [-1.0, -2.0, 8.0]}], "triggers": [], "ts": 1}

If we wanted to execute these commands in a flow, we needed to create a flow YAML, let's say, my_flow.yaml:

---
options:
  scale: 1e-6
  ts: 4e-9
  description: |
    My long description. It can take a single line or multiple lines.
    Line number two.
operations:
  - data.load:
      filepath: test.csv
  - data.subtract:
      pos: a
      neg: b
      dest: ab
      append: true

Now run hwpwn with:

$ hwpwn --verbose flow run test.yaml | cat
INFO: trying to load file test.csv ...
INFO: loaded 3 datapoints from test.csv.
INFO: found signal a
INFO: found signal b
INFO: found signal c
INFO: using sampling period of 4.0e-09 [s].
INFO: calculating signal subtract ab = a - b (append=True)
{"x_axis": [1.0, 2.0, 3.0], "signals": [{"name": "a", "vector": [3.0, 3.0, 9.0]}, 
{"name": "b", "vector": [3.0, 4.0, 2.0]}, {"name": "c", "vector": [4.0, 5.0, 1.0]}, 
{"name": "ab", "vector": [0.0, -1.0, 7.0]}], "triggers": [], "ts": 4e-09}

I've used the --verbose flag which will make it show what is happening. If you don't pipe the output of hwpwn, it will not show the final data to avoid flooding the console. Thus, I've used a piped cat command.

Documentation

The documentation is built with Sphinx and deployed in Github Pages. The URL is https://jemos.github.io/hwpwn.

Final Words

This project is currently in its early stages of development, and as such, it may not be as comprehensive or polished as desired. However, it is a work in progress, and future enhancements are expected to improve its functionality and usability in hardware security analysis. Users are encouraged to provide feedback and contribute to the project's growth and refinement.

Next Features...

Things I'd like to add in the future...

  • scope commands for interacting with USB osciloscopes
  • spa commands for simple power analysis
  • dpa commands for differential power analysis
  • cpa commands for correlation power analysis

Metadata

Release files for hwpwn 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hwpwn 0.1.2
File Size Uploaded Provenance
hwpwn-0.1.2.tar.gz 20.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hwpwn 0.1.2
File Interpreter ABI Platform
hwpwn-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 41.1 kB

Release files / hwpwn-0.1.2.tar.gz

Download URL hwpwn-0.1.2.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e4be7a9e4f3884005edb9790c487f2d8b628b5c6b62c926911703fb73f27d5c3
BLAKE2b-256 checksum
How to use checksums
72cc387eccdea582e818689c318c12109415182af5f3dc9be58cc1d00caf47cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / hwpwn-0.1.2-py3-none-any.whl

Download URL hwpwn-0.1.2-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a922e2c938f13f8d98fe1c02d2b45743063a78697ad855882036c0075573979
BLAKE2b-256 checksum
How to use checksums
cd59a5518022221949aa1a391626858173e0247e789f2c5de2a34c31c907cb0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for hwpwn 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page