---
title: "Rest PKI Core command: **gen-enc-key**"
description: "Reference for the Rest PKI Core gen-enc-key command, which generates a 256-bit encryption key for the General__EncryptionKey setting."
canonical: "https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/on-premises/tool/gen-enc-key"
locale: "en"
product: "Rest PKI Core"
last_updated: "2026-09-15"
---

# Rest PKI Core command: **gen-enc-key**

## Name

`gen-enc-key` - Generates a random encryption key (to encrypt sensitive database columns)

## Syntax

```sh
dotnet Lacuna.RestPki.Site.dll -- gen-enc-key
```

Or, on Docker:

```sh
docker run lacunasoftware/restpkicore:5.0 -- gen-enc-key
```

## Description

The `gen-enc-key` generates a 256-bit encryption key to be used on the setting `General__EncryptionKey`, which is used by Rest PKI Core to encrypt sensitive data
stored on the database.

## See also

* [Rest PKI Core command-line tool](https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/on-premises/tool)
