Skip to main content

Intelligent Data Tokenization for Enhanced Privacy and Security

Project description

Protecto.AI Python API Library

Intelligent Data Tokenization for Enhanced Privacy and Security

Protecto.AI employs a sophisticated approach to data tokenization, ensuring the intelligent handling of sensitive information. By leveraging this smart solution, you can unlock the full potential of your data while seamlessly upholding data privacy and security - all through the convenience of an API.

Installation:

To install Protecto.AI library, use the following command:

pip install protecto_ai

Usage Example:

ProtectoVault

Our tokenization process encompasses four distinct and customer-friendly methods for masking data:

To unmask data:

For more comprehensive information about our product, kindly visit our website.

Code Example:

Import the ProtectoVault class from the protecto_ai module

from protecto_ai import ProtectoVault

# Create an instance of ProtectoVault with your authentication token
obj = ProtectoVault("<auth_token>")

To obtain the auth token, please refer to the Step-by-Step Guide to Obtain Your Auth Token.

Mask with AutoDetect:

This method automatically identifies and masks personal/sensitive data within specific sentences, leaving the rest of the data intact.

# Pass a list of sensitive information as input for the mask method
result = obj.mask(["George Washington is happy", "Mark lives in the U.S.A"])
# Print the masked result
print(result)

This will give you the masked result:

{ 
  "data": [ 
    { 
      "value": "George Washington is happy", 
      "token_value": "<PER>wRePE302Qx vUc7DruuWm</PER> is happy", 
      "individual_tokens": [ 
        { 
          "value": "George Washington", 
          "pii_type": "PERSON", 
          "token": "wRePE302Qx vUc7DruuWm", 
          "prefix": "<PER>", 
          "suffix": "</PER>" 
        } 
    ] 
    }, 
    { 
      "value": "Mark lives in the U.S.A", 
      "token_value": "<PER>7FHnu7Uo2O</PER> lives in the <ADDRESS>oQLxg3gisk.G2jPUYZHcv.bHIrJ0Mb7k</ADDRESS>", 
      "individual_tokens": [ 
        { 
          "value": "Mark", 
          "pii_type": "PERSON", 
          "token": "7FHnu7Uo2O", 
          "prefix": "<PER>", 
          "suffix": "</PER>" 
        }, 
        { 
          "value": "U.S.A", 
          "pii_type": "GPE", 
          "token": "oQLxg3gisk.G2jPUYZHcv.bHIrJ0Mb7k", 
          "prefix": "<ADDRESS>", 
          "suffix": "</ADDRESS>" 
        } 
      ] 
    } 
  ], 
  "success": true, 
  "error": { 
    "message": "" 
  } 
} 

For more details, check the link.

Mask with a Specific Token:

This method allows you to mask input data according to default token types (Text token, Special Token, Numeric Token) specified.

# pass list of values as an input for the mask method.Provide default token type.
result = obj.mask(["Mark","Australia"], "Text Token")
# Print the masked result
print(result)

You can get list of default token types in this link.

Result:

{ 
  "data": [ 
    { 
      "value": "Australia", 
      "token_value": "1AN9X4Doab", 
      "token_name": "Text Token" 
    }, 
    { 
      "value": "Mark", 
      "token_value": "7FHnu7Uo2O", 
      "token_name": "Text Token" 
    } 
  ], 
  "success": true, 
  "error": { 
    "message": "" 
  } 

For more details, check the link.

Mask with a Specific Token and Format:

This method allows you to mask input data according to default token types (Text token, Special Token, Numeric Token) and formats specified.

# pass list of sensitive information as an input for the mask method. Provide default token type and format
result = obj.mask(["(555) 123-4567"], "Numeric Token", "Phone Number")
# Print the masked result
print(result)

You can get the list of default token types and formats in this link.

Result:

{ 
  "data": [ 
    { 
      "value": "(555) 123-4567", 
      "token_value": "(191004182137) 354826618175-127882693655", 
      "token_name": "Numeric Token", 
      "format": "Phone Number" 
    } 
  ], 
  "success": true, 
  "error": { 
    "message": "" 
  } 
} 

For more details, check the link.

Mask JSON Format:

# pass list of sensitive information as an input in the provided JSON Format for the mask method
result = obj.mask({"mask": [{"value": "Ross", "token_name": "Text Token", "format": "Person Name"}]})
# Print the masked result
print(result)

Result:

{ 
  "data": [ 
    { 
      "value": "Ross", 
      "token_value": "EZN792djTe", 
      "token_name": "Text Token", 
      "format": "Person Name" 
    } 
  ], 
  "success": true, 
  "error": { 
    "message": "" 
  } 
} 

For more details, check the link.

Unmask a Token:

This method allows you to retrieve the original data .

Let's take an example. If "George Williams" is masked as "wRePE302Qx vUc7DruuWm," and the user provides the second masked input, "vUc7DruuWm," the unmasked output would be "Williams."

result = obj.unmask(["<PER>wRePE302Qx vUc7DruuWm</PER> is happy","wRePE302Qx vUc7DruuWm","vUc7DruuWm"])
# Print the unmasked result
print(result)

Result:

{
  "data": [
    {
      "token_value": "<PER>wRePE302Qx vUc7DruuWm</PER> is happy",
      "value": "George Washington is happy"
    },
    {
      "token_value": "wRePE302Qx vUc7DruuWm",
      "value": "George Washington"
    },
    {
      "token_value": "vUc7DruuWm",
      "value": "Washington"
    }
  ],
  "success": true,
  "error": {
    "message": ""
  }
}

For more details, check the link.

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

protecto_ai-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protecto_ai-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file protecto_ai-1.0.0.tar.gz.

File metadata

  • Download URL: protecto_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for protecto_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3b8af649f89a4ad8033e3d7ebbfcbe3988d8571766057198e7a75501155f5b5c
MD5 736be46f44c8e5a1b65446f92a011b0d
BLAKE2b-256 4611e064c37f1a28d8f91a5c5662082086b8f876409249193ebe23e4e821163a

See more details on using hashes here.

File details

Details for the file protecto_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: protecto_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for protecto_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e39f8c5a13f7d8c5ac30f43f69da5ea322ec14175d67ee2ce257876edb4fc92d
MD5 600483a0aa0cd3667fc3b84d8c5c4902
BLAKE2b-256 c1a579a80ef9d48f816d37eacf139a44c040ca87013c1067f593733f5f23995f

See more details on using hashes here.

Supported by

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