# Capture Secure User Data

### Introduction

**Secure Strings** provide a way to capture sensitive information from the user. This might be the individual's password, their driver's license number, or maybe Social Security Number. This particular kind of information is some of the most sensitive information you can collect about a user and requires an extra level of care.

Using the Secure String Input in conjunction with the Secure Value Retrieval frame operation creates an end-to-end secure flow. You can safely retrieve the information within a data operation, and then utilize that information with subsequent frames within your data operation. This security model allows you to be certain that Airkit can capture secure information about your users without storing that information long term.

### Security Details

Data stored with the Secure String Input control cannot be accessed by the client, and can only be accessed via the Secure Value Retrieval frame operation. Each keystroke by the user is encrypted and transmitted over the network and back to our secure store, where the data is separated from the rest of the users data. This data is only stored for 30 minutes, so it’s important that you process or use this data in a timely fashion. After that allotted time, we scrub the data from our systems entirely.

### Securely Capturing Data Using Secure String Input Control

Secure String Input is one of the Form controls that you can add to the Canvas. Navigate to your card view or container, and click on the **+** button to add this control to your page.

![image-1.png](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-ba85f56a66e63b1c3ec2a0ef8084ee9fd757f541%2Fcapture-secure-user-data-v1715-0.png?alt=media)

Unlike normal String Inputs, you have to manually configure the variable you’d like the data to be saved to. After adding the control, navigate to the Actions tab in the inspector. Add a set-variable action to the **Value Changed** event. Enter the variable name, and for the value enter **event.value**.

Configuring this event will now ensure that as your users enter data into the control that it’s saved securely.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-71cc061c3af8c572ad50e4e2245c7695e13f395e%2Fcapture-secure-user-data-v1715-1.png?alt=media)

Finally, we’ll configure the masking options on the control. Go back to the General tab of the Secure Input Control, and find the icon options. By adding a password-visibility to either the left or right icon, you can now hide the input as the user is typing. This provides an additional layer of security to mask the users keystrokes as they are typing.

### Retrieving the Secure Data

Once your data is safely secured, you can extract it using a Data Operation. We’ll start by going to Connection Builder and creating a new Data Operation. Create an input for your Data Operation called **secure\_value\_key**. Add a Frame and select _Secure Value Retrieval_ as the frame operation. Provide the **secure\_value\_key** variable to this Frame.

The **Secure Value Retrieval** is a frame operation which retrieves your data from our secure store. This frame operation returns a variable with the original user input.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-5a9e3161ed913dc59ade3efdbb3fae9d1441a1e9%2Fcapture-secure-user-data-v1715-2.png?alt=media)

The output variable can be used in subsequent frame operations or it can be returned to the main application. If you return the secure value from the Data Operation, the value will no longer be secure.

### Using the Secure Data Operation

The retrieval operation data operation can be invoked anywhere an action can. A typical approach would invoke this data operation as part of a Submit button’s **onClick** event.

To start, lets look at the data that comes out of the input control:

```javascript
{
  "redisKey": "SecureStringInput-398dcf5c-115c-4994-aa65-1192ddf92f0f",
  "success": true
}

```

This contains 2 values, a **redisKey** and a **success** field. The **redisKey** is the key that you'll use to retrieve your secure value. The **success** value shows you if the data was successfully stored.

To configure the Data Operation, pass the **redisKey** in as the input to the Data Operation. This will go into the **secure\_value\_key** input variable. The **secure\_value\_key** will be the input into your **Secure Value Retrieval** frame operation, thus allowing you to retrieve the data for the specified key.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-152185779844513f8056c0410e3a0b9ea14df0e6%2Fcapture-secure-user-data-v1715-3.png?alt=media)

After configuring the action, you now can test the entire flow inside the debugger.
