Яндекс.Метрика
BYOK: Bring Your Own Key in Pachca

BYOK: Bring Your Own Key in Pachca

How encryption with your own key (BYOK) works in the Pachca team chat app

Pachca combines the convenience of a SaaS platform with full control over your encryption keys. Your company's messages stay confidential, and you can meet strict security requirements.

Overview

Pachca supports the Bring Your Own Key (BYOK) model. Your organization creates and manages its own encryption keys, and Pachca performs cryptographic operations without access to your master keys. This article covers the problems BYOK solves, the envelope encryption architecture, use cases, supported KMS providers and how different types of data are encrypted.

Why BYOK

What it provides

How BYOK helps

Confidentiality of messages and files

Encryption keys stay in the part of the infrastructure your organization controls.

Access control

An admin can revoke or rotate a key at any time and immediately block decryption of the data.

Data sovereignty

You can keep keys in a local data center, even if the data itself is hosted elsewhere.

Full access transparency

Demonstrates "Privacy by Design," auditing of key operations and minimal reliance on trust in the provider.

How it works: envelope encryption architecture

Advanced encryption is based on envelope encryption. To encrypt data, Pachca calls your Key Management Service (KMS) to generate a Data Encryption Key (DEK) for a piece of data, along with its encrypted version. Only the encrypted version is stored in the database. When Pachca needs to access encrypted data, it asks the KMS to decrypt the data key using the master key.

Operation flow

BYOK operation flow in Pachca
  1. Sending a message. The client app sends unencrypted content over SSL to the EKM service inside Pachca's infrastructure.

  2. Generating the DEK. EKM calls your Key Management Service and requests a DEK and an EDEK based on the provided encryptionContext (chat, organization, time). This connection can run over a VPN tunnel.

  3. Returning the DEK and the encrypted DEK. The KMS returns the DEK and the EDEK. The event is recorded in the KMS logs, which you can access.

  4. Encrypting the message. EKM immediately encrypts the content with the DEK. The plaintext is no longer stored.

  5. Saving to the database. EKM deletes the plaintext DEK from memory and saves the encrypted message and the EDEK to the database.

  6. Audit. A record of each wrap/decrypt operation is automatically sent to your logging system, providing full traceability.

Important: The master key never leaves your KMS. Decrypted encryption keys are kept in RAM only and are never written to disk.

Key hierarchy

Level

Purpose

Typical lifetime

Master Key (your key in the KMS)

Stored in the KMS and carries the access policy. Used to derive the KEK.

Years; rotated rarely.
KEK (Key Encryption Key)

Derived from the Master Key + Encryption Context. Defines access boundaries (chat, time, organization)

Constant for a given context; may be recreated when the policy changes
DEK (Data Encryption Key)

Encrypts a specific message or file

Minutes to hours; destroyed right after encryption

Use cases

  1. Full access transparency. KMS and app logs record every decryption operation. This speeds up incident investigations and builds customer trust.

  2. Flexible access control ("Kill Switch"). An admin can instantly disable the KEK and make all or part of the message history unavailable. This is a key part of a Zero Trust strategy and an incident response plan.

  3. Separation of duties (SoD). The security team manages the keys, the SaaS provider is responsible for the infrastructure and internal IT handles user administration.

  4. Contractual obligations and audits. Keys stay with your company, so you can clearly demonstrate compliance with NDAs, customer requirements and the terms of regulatory audits.

Advanced encryption vs. standard encryption

Advanced encryption adds to the standard encryption available to all Pachca users.

Data state

Advanced encryption

Standard encryption

In transit

Data is encrypted with customer-managed keys as early as possible: at the HTTP proxy or an equivalent entry point.

All interactions with the Pachca interface and API are encrypted over public networks using standard HTTPS and TLS 1.2+. This keeps traffic between you and Pachca secure in transit.

At rest

Data in the database stays encrypted. If a third party tries to access the live database, the data is returned as ciphertext.

Service data is encrypted at rest in Pachca using AES-256 keys.

In use

Data stays encrypted even while in use and is decrypted only when there is a specific business case. Every decryption operation is logged and can be reviewed in an external SIEM system.

Data is retrieved from storage and processed as plaintext.

Supported KMS providers (as of today)

  • Yandex Key Management Service

  • Cloud.ru

  • HashiCorp Vault. Unlike Yandex KMS, HashiCorp Vault also lets you restrict permissions through the encryption context. You can:

    • Limit a key to a specific chat or a list of chats.
    • Set a time window: for example, allow decryption only until a certain date or on a specific day.
    • Combine conditions (chat + date/period) in policies.
  • Deckhouse Stronghold

How different data is encrypted

Messages: A DEK is generated for each message or, when a conversation is active, for a group of messages.

Search index: The index is also encrypted through the KMS with a single KEK, so global search keeps working.

Files: Encrypted with the key of the message they belong to. Encryption runs asynchronously right after the file is uploaded to storage.

Setup guides

Detailed guides for setting up BYOK with different KMS providers:

Updated: September 16, 2025

More in Administration

Accounts in Pachca
How Pachca is structured: the difference between an account, a user and a member profile
Inviting your team
How to invite your team to Pachca, the team chat app: two ways to add employees
Change your email in Pachca
How to change your email address in Pachca: a guide for employees and administrators
Errors when adding people by email
Common errors when adding users to Pachca by email and how to fix them
Managing members in Pachca
Managing members in Pachca: how to add, edit and remove people from your team
Group tags
Add employees to all the chats they need at once with group tags
Advanced administration via API
How to automate user administration in Pachca with the API: creating users, managing them and tags
Ports and addresses Pachca needs
Ports and addresses Pachca needs to work properly: setting up your corporate firewall
Storage in Pachca
Everything about file storage in Pachca: limits, managing storage space and working with documents
Setting up DLP in Pachca
Add an extra layer of protection for personal data, tokens and passwords
Internal/external file access
How to set up internal and external zones in Pachca to protect your company documents
Two-factor authentication (2FA)
How to turn on two-factor authentication in Pachca for extra account security
Import chats from Slack
How to import your chat history from Slack into Pachca: a step-by-step migration guide
Import chats from Mattermost
Pachca lets you move your chat history and files from Mattermost into your workspace.
Import chats from Telegram
If your team is moving to Pachca from Telegram, you can bring your chat history over to your team chat app.
Exporting messages from Pachca
How to export messages from Pachca: data format, settings and export limitations
SSO options in Pachca
Single sign-on (SSO) in Pachca: SAML, LDAP and Keycloak connection options and step-by-step guides
SSO in Pachca with LDAP
SSO in Pachca with Multifactor.ru
SSO in Pachca with Blitz Identity Provider
SSO in Pachca with Authentik
SSO in Pachca with Keycloak
SSO in Pachca with Azure OpenID
SSO in Pachca with ADFS OpenID
This guide explains how to configure ADFS on Windows Server 2016 or later to connect it to Pachca.
SSO in Pachca with Google Workspace SAML
SSO in Pachca with Indeed IdP over SAML
SSO in Pachca with Yandex 360
SSO in Pachca with Yandex Identity Hub
Advanced encryption in Pachca
How to set up advanced encryption in Pachca for extra protection of your company data
Set up BYOK with HashiCorp Vault
Set up BYOK with Yandex KMS
Set up BYOK with Cloud.ru KMS