---
title: Encrypt column
description: Securely encrypt selected columns using one-way or two-way encryption methods.
category: Data Security
tags: [encryption, hash, secure, transformation, data masking]
---

# Encrypt column

## Description

The **Encrypt Column** activity secures sensitive data by encrypting the values of one or more specified columns.  
It supports both **one-way hashing** (e.g., SHA algorithms) for irreversible encryption and **two-way encryption** (e.g., symmetric encryption using passwords) for reversible use cases.

> **Use case**: Protect user credentials or personally identifiable information (PII) before storing or sharing datasets.

---

## Input

| Type | Description                |
| ---- | -------------------------- |
| Data | A tabular dataset as input |

---

## Output

| Type | Description                                |
| ---- | ------------------------------------------ |
| Data | Returns the dataset with encrypted columns |

---

## Configuration Fields

| Field Name          | Required    | Description                                                                             |
| ------------------- | ----------- | --------------------------------------------------------------------------------------- |
| **Encryption type** | Yes         | Choose between `one-way` (irreversible hash) or `two-way` (reversible using password).  |
| **Algorithm**       | Conditional | Select algorithm for one-way encryption (e.g., SHA-256, SHA-1). Shown only for one-way. |
| **Column names**    | Yes         | One or more columns whose values will be encrypted.                                     |
| **Password**        | Conditional | Used for two-way encryption to encode and decode the values.                            |

---

## Sample Input

| h1    | h2     | h3    |
| ----- | ------ | ----- |
| data1 | value1 | info1 |
| data2 | value2 | info2 |
| data3 | value3 | info3 |

---

## Sample Configuration

| Field           | Value       |
| --------------- | ----------- |
| Encryption type | Two-way     |
| Column names    | `h1`, `h2`  |
| Password        | `MySecret!` |

---

## Sample Output (Two-Way Encryption)

| h1                                   | h2                                   | h3    |
| ------------------------------------ | ------------------------------------ | ----- |
| 3b9d9b8d-6d93-4648-b33a-2c6f773789a7 | 9b1b5c9a-bc5e-4a99-b38d-d9c34cf7cfd6 | info1 |
| 33d3bff6-e469-46f7-9d7c-4bc12d5d59a1 | 7b77f40b-9375-479d-bdf7-dcc95f07b99c | info2 |
| b3c3e828-2cb7-4de9-bf1c-62aef6fffa97 | 6729f1d8-3781-4315-8fe1-8b042708f25e | info3 |

---

## Sample Output (One-Way Encryption using SHA-1)

| h1                                      | h2                                       | h3    |
| --------------------------------------- | ---------------------------------------- | ----- |
| 6d97a6b8b9899b0a59b6e85b993b22a8ac94608 | e59b4d1a83149cdad8379a35de8f4a4a853a4cc8 | info1 |
| f62b083e8f63d69a91e16f0db11b19589f2fcf1 | 548f56b831617f4f8df5e705b2b76e8d8c4b03b9 | info2 |
| f78c6d99b6e04d0c5397423fb4cd58f79f228d2 | 2d72c30ecedc493139de2bc57290ed40f763ada  | info3 |

---

> Use **one-way encryption** for passwords and sensitive values you don’t need to retrieve.  
>  Use **two-way encryption** when data must be decrypted later for analysis or export.
