Skip to main content

Bayes Vulnerability for Microdata library

Project description

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 [^compatibility].

[^compatibility]: To understand how the various GNU licenses are compatible with each other, please refer to:

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

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

bvmlib-1.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

bvmlib-1.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file bvmlib-1.1.0.tar.gz.

File metadata

  • Download URL: bvmlib-1.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for bvmlib-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1ad4052c94ff117e1e91f9f027dbc7a935da9d2162a436aa144731361acaf144
MD5 eabd698cb580d0fa55d604d7f362e715
BLAKE2b-256 0f13d65acb78deb761aad9129b91437c6a48cae799cc97f7587967648dfcc596

See more details on using hashes here.

File details

Details for the file bvmlib-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: bvmlib-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for bvmlib-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb648bdd19162ba8cf89ac080128b41daf07d2a8aab9113010a372ae4c3213c5
MD5 e97fb43bf984ed5631cd00298180d0d5
BLAKE2b-256 47c9ffc31b2b57b90131f2e1451b779b4a514998a02c9dbc2f6c39903bd6961d

See more details on using hashes here.

Supported by

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