Skip to main content

Hardware security testing tool

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hwpwn-0.1.2.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hwpwn-0.1.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file hwpwn-0.1.2.tar.gz.

File metadata

  • Download URL: hwpwn-0.1.2.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for hwpwn-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e4be7a9e4f3884005edb9790c487f2d8b628b5c6b62c926911703fb73f27d5c3
MD5 60524073e82bc64e47983772e5db2ba3
BLAKE2b-256 72cc387eccdea582e818689c318c12109415182af5f3dc9be58cc1d00caf47cd

See more details on using hashes here.

File details

Details for the file hwpwn-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: hwpwn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for hwpwn-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a922e2c938f13f8d98fe1c02d2b45743063a78697ad855882036c0075573979
MD5 7ad9949f6f292a76c75b093bf2ef7b32
BLAKE2b-256 cd59a5518022221949aa1a391626858173e0247e789f2c5de2a34c31c907cb0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page