Secure cryptographic channel demonstrating ECDH, AES-256-GCM, and HMAC integrity. Independent of Microsoft Presidio (a data-anonymization toolkit).
Project description
presidio-hardened-crypto-channel
Secure cryptographic channel demonstrating ECDH key exchange, AES-256-GCM authenticated encryption, and HMAC integrity. Used in Experiment 1 of PRES-EDU-SEC-101 — Computer Security.
Setup
git clone https://github.com/presidio-v/presidio-hardened-crypto-channel.git
cd presidio-hardened-crypto-channel
pip install -r requirements.txt
Experiments
Run 1 — ECDH Key Exchange
python main.py --demo keyexchange --parties Alice Bob
Both parties derive identical session keys without transmitting the secret.
Run 2 — AES-256-GCM Encryption
python main.py --demo symmetric --message "Hello from Alice" --key-size 256
Run 3 — Full Secure Channel
python main.py --demo channel --client Alice --server Bob --messages 10
Run 4 — Break It: Remove HMAC
python main.py --demo channel --no-hmac --tamper
Without authentication, a tampered message is detected by the GCM tag — demonstrating that AES-GCM provides both confidentiality and integrity.
Run 5 — Measure
python main.py --demo channel --messages 100 --duration 60
python report.py --experiment 1
What to Observe
--no-hmac --tamper: AES-GCM's auth tag catches the flip —InvalidTagraised--tamper(HMAC on): HMAC check fires first, before decryption attempt- Key takeaway: encryption provides confidentiality; GCM tag / HMAC provides integrity
Package Structure
src/presidio_crypto_channel/
├── keyexchange.py X25519 ECDH + HKDF
├── symmetric.py AES-256-GCM
├── channel.py Full channel with optional HMAC
└── security.py Logging + pip-audit
License
MIT
SDLC
This repository is developed under the Presidio hardened-family SDLC: https://github.com/presidio-v/presidio-hardened-docs/blob/main/sdlc/sdlc-report.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file presidio_hardened_crypto_channel-0.1.0.tar.gz.
File metadata
- Download URL: presidio_hardened_crypto_channel-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0a51e1d349a9c23ed35fad0a04bd4200bc14ad1639067dc73c506429ba065b7
|
|
| MD5 |
ebab89a5d5378fb3f0f9b1c9a615c2e2
|
|
| BLAKE2b-256 |
af78baa2ccac7ff1e8ae3f76ce1f1805165a295798ceababfbecb51803c5c5e8
|
Provenance
The following attestation bundles were made for presidio_hardened_crypto_channel-0.1.0.tar.gz:
Publisher:
publish.yml on presidio-v/presidio-hardened-crypto-channel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
presidio_hardened_crypto_channel-0.1.0.tar.gz -
Subject digest:
f0a51e1d349a9c23ed35fad0a04bd4200bc14ad1639067dc73c506429ba065b7 - Sigstore transparency entry: 1791794571
- Sigstore integration time:
-
Permalink:
presidio-v/presidio-hardened-crypto-channel@3b960fdd0b5f93241bb8dcca3b061ead9ad66dcd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/presidio-v
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b960fdd0b5f93241bb8dcca3b061ead9ad66dcd -
Trigger Event:
push
-
Statement type:
File details
Details for the file presidio_hardened_crypto_channel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: presidio_hardened_crypto_channel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a004d65ed4f43a3e6979762e7c059181f6c93de229aae71e30e4febfe795769
|
|
| MD5 |
36eb4f257c5b8419280cdaeb1fa9b509
|
|
| BLAKE2b-256 |
2a3d1cb69e4ae1220063fca34e1f1aa36ca47332db46697a8ab557bc421e09ec
|
Provenance
The following attestation bundles were made for presidio_hardened_crypto_channel-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on presidio-v/presidio-hardened-crypto-channel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
presidio_hardened_crypto_channel-0.1.0-py3-none-any.whl -
Subject digest:
0a004d65ed4f43a3e6979762e7c059181f6c93de229aae71e30e4febfe795769 - Sigstore transparency entry: 1791794613
- Sigstore integration time:
-
Permalink:
presidio-v/presidio-hardened-crypto-channel@3b960fdd0b5f93241bb8dcca3b061ead9ad66dcd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/presidio-v
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b960fdd0b5f93241bb8dcca3b061ead9ad66dcd -
Trigger Event:
push
-
Statement type: