---
title: Securing Customer Documents with Password Protection
slug: api-marketplace/securing-customer-documents-with-password-protection
createdAt: 2024-01-14T06:09:29.447Z
---

## Introduction

This guide details the implementation of password protection for files obtained via Digilocker APIs. Aimed at enhancing data security, this feature ensures that sensitive documents are encrypted with a password, safeguarding them against unauthorized access. We will cover the essential steps and best practices to seamlessly integrate this security measure, thereby reinforcing the privacy and integrity of the data exchanged through Digilocker APIs.

***

### Steps to Access the Feature:

**Step 1: Obtain Signzy's Public Key**: Contact the Signzy support team at [support@signzy.com](#) to receive the public key required for encryption.

**Step 2: Encrypt Password**: After obtaining the public key, encrypt your chosen password using RSA encryption and convert it to base64 format. The sample code provided demonstrates how to perform this encryption using different languages.

```javascript
const crypto = require('crypto');
const fs = require('fs');

// Load Signzy public key
const SignzyPublicKey = fs.readFileSync('signzyPublickey.pem', 'utf-8');

function encryptPassword(password) {
  const bufferPassword = Buffer.from(password, 'utf-8');
  const encrypted = crypto.publicEncrypt(SignzyPublicKey, bufferPassword);
  return encrypted.toString('base64');
}

const password = 'client_password';
const encryptedPassword = encryptPassword(password);
console.log('Encrypted Password:', encryptedPassword);

```

**Step 3: Integrate Encrypted Password**: Pass the encrypted password in the [Create URL API](https://docs.signzy.com/api-marketplace/create-url-api) call body as **`persistPassword`**.

**Step 4: Accessing Password-Protected Files**: When making requests to access files from Digilocker, they will now be password-protected. To access these files, append the `key` **query parameter** to the file URLs with the **unencrypted password** as its value.

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!



