Sign inSign up

mds4ul/pprl-mask

By mds4ul

Updated over 3 years ago

Image
0

911

mds4ul/pprl-mask repository overview

PPRL entity mask service

This service provides entity masking capabilities for Bloom filter based PPRL.

Installation

To run an ephemeral container, use the line below.

docker run --rm -p 8080:8080 -d mds4ul/pprl-mask:latest

You can also compile this project by hand and run the standalone executable JAR. Dependencies are stored in target/libs and are referenced in the JAR manifest file.

mvn clean package
cd target
java -jar pprl-mask-service-1.0-SNAPSHOT.jar

Example request

import json
import requests

r = requests.post("http://localhost:8080", json={
    "masking": {
        "tokenSize": 2,
        "hashValues": 5,
        "hashFunction": "HMAC-SHA256",
        "key": "s3cr3t",
        "seed": 123,
        "hashStrategy": "randomHash",
        "filterType": "CLKRBF",
        "hardeners": [
            {
                "name": "balance"
            },
            {
                "name": "permute",
                "seed": 456
            },
            {
                "name": "xorFold"
            }
        ]
    },
    "entities": [
        {
            "id": "001",
            "firstName": "maximilian",
            "lastName": "jugl",
            "birthDate": "19980629"
        },
        {
            "id": "002",
            "firstName": "lars",
            "lastName": "hempel",
            "birthDate": "19960212"
        }   
    ],
    "attributes": [
        {
            "name": "firstName",
            "weight": 2,
            "averageTokenCount": 11
        },
        {
            "name": "lastName",
            "weight": 2,
            "averageTokenCount": 5
        },
        {
            "name": "birthDate",
            "weight": 1.5,
            "averageTokenCount": 9
        }
    ]
})

print(json.dumps(r.json(), indent=2))
# {
#   "entities": [
#     {
#       "id": "001",
#       "value": "UunAZyUznBpz0_3_FtYk4w4AqXRRBMOMTPbNDwg="
#     },
#     {
#       "id": "002",
#       "value": "JPSTdVKH3VKBPTUeuB9fjxzJZWs72CL9x9mZQw=="
#     }
#   ]
# }

License

MIT.

Tag summary

Content type

Image

Digest

sha256:1b1a159c9

Size

41.7 MB

Last updated

over 3 years ago

docker pull mds4ul/pprl-mask