Skip to main content

BVM library

DOI (v1.0)

Quantitative Information Flow assessment of vulnerability for microdata datasets using Bayes Vulnerability.

DOI (v1.0): 10.5281/zenodo.6533704.

This repository provides an implementation of the paper Flexible and scalable privacy assessment for very large datasets, with an application to official governmental microdata (DOI: 10.56553/popets-2022-0114, arXiv: 2204.13734) that appeared in PoPETs 2022, and of the masters thesis A formal quantitative study of privacy in the publication of official educational censuses in Brazil (DOI: hdl:1843/38085). Please refer to the folder examples for the Notebooks containing the actual results for the experiments performed.

Installation

Use the package manager pip to install bvmlib.

pip install bvmlib

Usage

Warning: Please fill NA and NaN values!

A fix will be provided in a later version.

Meanwhile, consider using the pandas .fillna() method before calling the BVM() class, e.g. when creating the pandas DataFrame, as shown below.

Single-dataset

import pandas
from bvmlib.bvm import BVM

# Create a pandas DataFrame for your data.
# For instance:
df = pandas.read_csv(file.csv).fillna(-1)

# Create an instance.
I = BVM(df)

# Assign quasi-identifying attributes.
I.qids(['attribute_1','attribute_2'])

# Assign sensitive attributes (optional).
I.sensitive(['attribute_2','attribute_3'])

# Perform vulnerability assessment.
I_results = I.assess()

# Print re-identification results.
print(I_results['re_id'])

# Print attribute-inference results (only if computed).
print(I_results['att_inf'])

Additional examples

Please refer to the folder examples for additional usage examples, including attacks on longitudinal collections of datasets.

Note on the results

For privacy assessment of Collective Re-identification (CRS / CRL), for each list of quasi-identifying attributes (QID), the following results are computed:

  • dCR: corresponds to the deterministic metric;
  • pCR: corresponds to the probabilistic metric;
  • Prior: corresponds to the adversary's prior knowledge in a probabilistic attack;
  • Posterior: corresponds to the adversary's posterior knowledge in a probabilistic attack;
  • Histogram: corresponds to the distribution of individuals according to the chance of re-identification.

For privacy assessment of Collective (sensitive) Attribute-inference (CAS / CAL), for each list of quasi-identifying attributes (QID) and for each sensitive attribute (Sensitive), the following results are computed:

  • dCA: corresponds to the deterministic metric;
  • pCA: corresponds to the probabilistic metric;
  • Prior: corresponds to the adversary's prior knowledge in a probabilistic attack;
  • Posterior: corresponds to the adversary's posterior knowledge in a probabilistic attack;
  • Histogram: corresponds to the distribution of individuals according to the chance of attribute-inference.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU LGPLv3 1.

  1. To understand how the various GNU licenses are compatible with each other, please refer to:

    https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility ↩

Metadata

Release files for bvmlib 1.1.0

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

Source distribution (sdist)

Source distribution for bvmlib 1.1.0
File Size Uploaded
bvmlib-1.1.0.tar.gz 11.9 kB Details

Built distribution (wheel)

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

Total release size: 23.1 kB

Release files / bvmlib-1.1.0.tar.gz

Download URL bvmlib-1.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1ad4052c94ff117e1e91f9f027dbc7a935da9d2162a436aa144731361acaf144
BLAKE2b-256 checksum
How to use checksums
0f13d65acb78deb761aad9129b91437c6a48cae799cc97f7587967648dfcc596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release files / bvmlib-1.1.0-py3-none-any.whl

Download URL bvmlib-1.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb648bdd19162ba8cf89ac080128b41daf07d2a8aab9113010a372ae4c3213c5
BLAKE2b-256 checksum
How to use checksums
47c9ffc31b2b57b90131f2e1451b779b4a514998a02c9dbc2f6c39903bd6961d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.1.0 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