Skip to content
Magento glossary

What is the Magento crypt-key?

Short answer The Magento encryption key is protected deployment material used by the application Encryptor for data that requires reversible encryption. It is associated with the crypt/key configuration setting. Key rotation, stored-data re-encryption, password hashing and recovery are separate concerns, with behavior determined by the installed release and integrations.

How it works
  1. Deployment supplies protected key material 01
  2. Only participating data uses this encryption mechanism 02
  3. Cipher and key versions matter to stored values 03
  4. Rotation changes the key lifecycle 04
  5. Re-encryption and recovery require an inventory of affected data 05
Each step is explained below

Watch for this Replacing the value without preserving the data relationship

How it works

From protected key material to encrypted application data

Understand the participating data and supported lifecycle before treating a key change as a repair.

  1. 01

    Deployment supplies protected key material

    Magento's Encryptor obtains its key material from deployment configuration. The default on-premises location is the crypt/key setting associated with app/etc/env.php. Treat that material as a secret: the public path name is documentation, not a reason to print the value into logs or support messages.

  2. 02

    Only participating data uses this encryption mechanism

    An encrypted configuration backend can encrypt a value before saving and decrypt it when needed. Other passwords, tokens and payment integrations may use different hashing or storage designs. Do not assume every secret or saved-payment reference is encrypted in the same way.

  3. 03

    Cipher and key versions matter to stored values

    Encrypted payloads carry format/version information used by the implementation. Current Adobe guidance and the inspected Encryptor use ChaCha20-Poly1305 for new standard encryption, with legacy handling present. An AES/version claim copied from an old tutorial is not a reliable description of every release or stored value.

  4. 04

    Rotation changes the key lifecycle

    Use the documented process for the exact release and deployment model. Rotating key material can affect sessions and application behavior. It does not automatically prove that every encrypted database column or custom integration field has been rewritten.

  5. 05

    Re-encryption and recovery require an inventory of affected data

    Adobe documents separate configured re-encryptors for certain system and payment data, with extension points for custom fields. Keep protected recovery material and matching backups under controlled access. Test the required behavior without exposing real keys or decrypted values.

When to rotate

When the key lifecycle needs review

Deployment, suspected exposure, upgrades and new encrypted fields require a defined plan and protected evidence.

  • A deployment or recovery is planned

    A database and its relevant encryption material must remain compatible. Define secure backup and restoration ownership before moving data. Copying production secrets into an uncontrolled development environment is not a safe shortcut.

  • Key exposure is suspected

    Follow the applicable incident and Adobe security guidance for the exact environment. Key rotation belongs with patching, affected-data review and validation; it is not a substitute for understanding the exposure.

  • An upgrade changes supported encryption behavior

    Review release-specific key and re-encryption tooling and custom modules. Old Admin instructions, CLI names and assumptions about storage formats may no longer apply.

  • A module adds encrypted fields

    Use the supported encryption interfaces and appropriate configuration backend where they fit. Document the data locations and re-encryption requirements. A field being hidden in Admin is not evidence that its stored value is encrypted.

Common mistakes

Three key-management assumptions to avoid

Do not expose key values or infer complete data migration from a successful rotation operation.

  • Replacing the value without preserving the data relationship

    A random replacement cannot decrypt ciphertext created with missing original material. Review supported rotation, key-version handling and recovery before changing anything. Do not delete old key material on the assumption that all data was automatically migrated.

  • Sharing a real key during diagnosis

    Do not paste keys, full environment files or decrypted values into chat, screenshots, tickets or repositories. Diagnose with redacted structure and authorized private inspection. A public comparison service is not an appropriate place to validate a deployment secret.

  • Assuming a rotation command covers every custom field

    Default re-encryptors have a defined scope. Custom modules can use other encrypted storage and need their own reviewed handlers or migration process. Verify the required data and workflows rather than inferring success from one command exit code.

FAQ

Magento crypt-key: frequently asked questions

  • Can I change the crypt-key manually by editing env.php?
    A direct replacement can make existing encrypted data unreadable. Use the documented release-specific rotation process and a reviewed recovery plan. Do not paste a new value into a live file as a speculative repair, and do not expose either the old or new material while investigating.
  • What happens if I’ve lost the original crypt-key?
    A newly generated key cannot recover ciphertext encrypted with missing original material. Seek an authorized matching backup or protected key-management record and assess the affected data. Recovery scope depends on what remains available; there is no universal key-recovery command or guaranteed outcome.
  • Does the crypt-key rotation require downtime?
    Plan for operational impact rather than promising a zero-downtime change. Current Adobe guidance describes coordinated maintenance and warns that rotation invalidates customer/Admin sessions except integration users. The exact process, data re-encryption and verification depend on the release, deployment and custom integrations.
  • How long should the crypt-key be?
    Use the supported key-generation and validation mechanism for the installed release. Current Adobe documentation describes a 256-bit key with ChaCha20-Poly1305, but textual encoding and legacy compatibility are implementation details. Character count alone is not a trustworthy strength or compatibility check.
  • Is the crypt-key the same as Magento’s password hash salt?
    No. Reversible encryption and password hashing have different purposes. A password hash is designed to verify a password without recovering its original value; the encryption material supports data that the application must decrypt. Review the exact storage implementation instead of assuming a key change is a password-reset operation.
  • How do I check if my crypt-key is the Adobe Commerce Cloud default weak key?
    Do not treat a public sample string as a universal Cloud security check or send a real key to a validator. Review the relevant Adobe security notice, deployment provenance and authorized private configuration process. If exposure is suspected, follow a reviewed incident/rotation plan without disclosing the value.
Crypt-key audit

Planning an encryption-related change?

Describe the release, affected workflow and deployment model using redacted information. Keep key values, full environment files and decrypted data out of the enquiry.

Kishan Savaliya Online 10 AM to 7 PM IST Chat on WhatsApp