Skip to main content

SHRUG is a simple Python library that lets users anonymize source and destination IP addresses in packet traces. As of the current release, SHRUG supports the following anonymization algorithms:

  1. Randomizer algorithm (randomizer)
  2. Prefix Preserving algorithm (prefAnon) [Using CryptoPAn]
  3. BlackMarker algorithm (blackMarker)
  4. Permutation algorithm (permutation)
  5. Truncation algorithm (truncation)
  6. Reverse Truncation algorithm (revTruncation)

Usage

  • Install the package using pip
pip install SHRUG-anon
  • Import the module and the anonymization methods
>>> from SHRUG_anon import anonalgos
  • The read_from method can be used to read a .pcap or .tcpdump file
>>> input_pks = anonalgos.read_from("/path/to/pcap/tcpdump/file")
  • Use one of the six anonymization algorithms on the packet capture stored in the previous step, and store the anonymized packets.
>>> anonalgos.randomizer(input_pks)
>>> anonalgos.write_to("/path/to/anonymized/packets/.pcap/.tcpdump")
  • NOTE: The truncation and reverse truncation algorithms require a second parameter, i.e., the number of bits to be truncated.
>>> anonalgos.truncation(input_pks, 12)

Metadata

Release files for SHRUG-anon 1.0.1

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

Source distribution (sdist)

Source distribution for SHRUG-anon 1.0.1
File Size Uploaded
SHRUG_anon-1.0.1.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SHRUG-anon 1.0.1
File Interpreter ABI Platform
SHRUG_anon-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 kB

Release files / SHRUG_anon-1.0.1.tar.gz

Download URL SHRUG_anon-1.0.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ae4eae22d78a55c9da04e2c782d02be459cc48e70ede3cca6bb1f7352233952e
BLAKE2b-256 checksum
How to use checksums
5781e15259f56cbf33c62f4f0b097a67615ee564996976ef5fb4ddae5bfce532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / SHRUG_anon-1.0.1-py3-none-any.whl

Download URL SHRUG_anon-1.0.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64ff889140a0f7e67d4a091a69f20b6ba52d66e1b762f293ca26fc9570f36ba9
BLAKE2b-256 checksum
How to use checksums
0dc98d2bd2946a001293ed1290ede84d9355bb41040d4accb1280614159fc3f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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