Updated on December 4, 2023

Unmask a Token

In tokenization, unmasking is the procedure of reversing the masking process to recover the original sensitive data from its masked representation.

  • The ProtectoVault object is instantiated with your tokenization key.
  • The input needs to consist of a list of masked text.
  • The unmask method is then used to retrieve the original data from the previously masked result.

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 should be “Williams.”

The user can also submit a list of masked inputs, such as <masked value1>,<masked value2> etc to obtain the respective unmasked values.

Learn more by checking out the section on Supporting Token and Format Types.

Note: To obtain the <auth token>, please refer to the Step-by-Step Guide to Obtain Your Auth Token

Example :

Code Snippet 

# 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>")
# Use the unmask method to retrieve the actual data.
result = obj.unmask(["<PER>wRePE302Qx vUc7DruuWm</PER> is happy"])
# Print the unmasked result
print(result)

Result: 

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

For more comprehensive information about our product, kindly reach out to us through our website at https://www.protecto.ai/

What are your feelings
Scroll to Top