# Generate Keys

The Othentic CLI simplifies key generation and encryption into Keystore files.&#x20;

#### Read More

* [CLI Command Reference: Generate Keys](https://docs.othentic.xyz/main/reference/othentic-cli/wallet/encrypt)

### Prerequisites

* [Othentic CLI installed](https://docs.othentic.xyz/main/welcome/getting-started/install-othentic-cli)

{% stepper %}
{% step %}

### Run the encrypt command

If you already have raw keys generated using another tool, these can also be used directly in either raw format or as Keystore files.

```bash
otcli wallet encrypt --private-key <PRIVATE_KEY> --keystore-dir <KEYSTORE_PATH>
```

* **`PRIVATE_KEY`**: A raw 32-byte private key to encrypt as keystore. If not supplied, CLI will auto-generate a new private key and proceed to encrypt it.
* **`KEYSTORE_PATH`**: Path to the JSON-formatted Keystore file. If not supplied, a UUID-based filename will be auto-generated and saved under the `.keystore` directory.
  {% endstep %}

{% step %}

### Enter your password

This password will be used to decrypt the files. **Make sure it's securely backed up.**
{% endstep %}

{% step %}

### Securely store the keystore file

The program will print the location and name of the created file.

It is recommended to create a secure backup of this file for easy recovery.
{% endstep %}
{% endstepper %}
