October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

What Is the Magento Encryption Key and How to Manage It

Magento stores its encryption key in app/etc/env.php under crypt.key. This guide explains how to protect it, rotate it on current releases, handle forced logins, and re-encrypt built-in and custom encrypted data.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Magento encryption key is the secret value that Adobe Commerce and Magento Open Source use to protect passwords and other sensitive data. It is stored as crypt.key in app/etc/env.php, created or supplied during installation, and required whenever Magento must decrypt protected values. Treat it like a production credential: keep it out of source control, restrict access, preserve it through backups and migrations, and record any replacement key securely.

On current releases, including 2.4.8 and later, rotate the key from the command line with bin/magento encryption:key:change. A safe rotation is a maintenance operation: pause traffic-producing jobs, change the key, flush caches, re-encrypt documented data, and expect customers and administrators to sign in again.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the Magento encryption key does

Adobe describes the key as a protection mechanism for passwords and other sensitive values in both Adobe Commerce and Magento Open Source. Magento uses it for values that must later be decrypted, such as credentials or payment-related configuration stored by the application. It also uses one-way hashing for values that only need to be compared and never recovered in plaintext.

Encryption and hashing are different operations

For data that requires decryption, Adobe documents the industry-standard ChaCha20-Poly1305 algorithm with a 256-bit key. A 256-bit key is the cryptographic secret represented by the crypt.key setting; it is not a customer password and should not be shortened, reformatted, or replaced with a memorable phrase.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

For data that does not need to be decrypted, Adobe documents SHA-256 hashing instead. A hash is designed for verification rather than recovery, so changing the encryption key does not turn a hashed value back into its original text. The distinction matters when planning a migration: encrypted fields may need re-encryption, while one-way hashed values follow their own application logic.

When the key is created

The installer creates the key during Magento installation. Depending on the installation path, Commerce can generate a key or accept one supplied by the installer. The resulting configuration is represented in app/etc/env.php by a crypt section containing a key value:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
'crypt' => [
    'key' => 'your-secret-value'
],

The example shows the structure only; never copy the example text into a live store. The key must remain the exact secret used to protect the existing data.

Where Magento stores the key

On a standard installation, the operational location is:

<Magento application root>/app/etc/env.php

Within that PHP configuration file, the relevant setting is crypt.key. The file also commonly contains other environment-specific credentials and service settings, so protecting the entire file is safer than trying to expose only one line.

Keep it out of source control

Adobe’s sensitive-settings guidance explicitly says not to include env.php in source control. A public repository, a shared code archive, a build artifact, or an unrestricted deployment log can turn the key into a permanent incident. Add the file to the repository’s ignore rules, check that it is not already tracked, and prevent CI systems from printing its contents when assembling configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Control filesystem and operational access

  • Allow only the Magento application, deployment identity, and specifically authorized operators to read the file.
  • Do not paste the key into tickets, chat messages, shell history, screenshots, or issue comments.
  • Store protected backups and deployment copies in a controlled secret-management process with access logging and role-based permissions.
  • When restoring or migrating a store, make sure the original key is available before attempting to read encrypted data.
  • Keep a secure record of any newly generated key after rotation; losing it can prevent recovery of data encrypted under that key.

These controls are operational consequences of the key’s purpose: Magento cannot decrypt protected values without the matching secret.

Which key-management method your release supports

The user interface has changed across Magento releases. Adobe says the Admin encryption-key feature was deprecated and removed in 2.4.8. Use the CLI workflow on 2.4.8 and later, and verify the command exists before scheduling a change.

Release situation Supported management path Operational implication
Magento 2.4.8 and later bin/magento encryption:key:change The Admin rotation screen is removed; perform the change during a controlled maintenance window.
Older releases where the Admin feature is present Follow the release’s documented procedure, preferably validating it in a staging copy first. The Admin feature was deprecated, so plan a CLI-based process before upgrading to 2.4.8 or newer.

Do not assume that a menu visible on an older installation exists after an upgrade. The command-line check in the next section gives a definitive answer for the code currently deployed.

Before rotating the key

Rotation changes the secret used to protect data. Treat it as a coordinated deployment rather than an isolated configuration edit.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pre-rotation checklist

  • Confirm the exact Magento release and whether the deployment is Adobe Commerce Cloud or self-managed/on-premises.
  • Confirm that app/etc/env.php is writable by the account that will run the Magento command.
  • Take a verified backup through your normal recovery process, including the database and the protected configuration file.
  • Identify every custom module or column that stores encrypted data; the built-in re-encryptors cover only the documented default scopes.
  • Arrange a maintenance window and notify support staff that active shoppers and administrators will be asked to authenticate again.
  • Ensure an authorized operator can securely record and retrieve the new key.
  • On Cloud, have access to the Cloud tooling needed to disable cron and flush cache. On-premises, have access to the crontab or scheduler that launches Magento cron.

Do not start a rotation while deployment automation, imports, payment jobs, or other writers can change encrypted values. Pausing those processes prevents concurrent work from using different key states.

Rotate the key from the command line

Adobe’s current sequence is deliberately ordered. Follow it on the production environment, adjusting only the Cloud-versus-on-premises commands.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
  1. Confirm writability. Check that the deployed app/etc/env.php can be updated by the account running Magento. Resolve ownership or permission problems before continuing.
  2. Enable maintenance mode. From the Magento application root, run:
    bin/magento maintenance:enable

    Confirm that the storefront and administrative entry points present the expected maintenance response.

  3. Stop cron. On Adobe Commerce Cloud, run:
    ./vendor/bin/ece-tools cron:disable

    On an on-premises installation, pause the crontab or scheduler that invokes Magento cron. Do not merely stop one worker if another scheduler can still launch jobs.

  4. Confirm the command is available. Run:
    bin/magento list | grep encryption:key:change

    If no matching command appears, stop and identify the release or deployment issue instead of editing env.php by hand.

  5. Change the key. Run:
    bin/magento encryption:key:change

    Wait for the command to finish and verify that it reports no errors. Preserve the newly generated or supplied key in your controlled secret record.

  6. Flush cache. On Cloud, use the Cloud cache-clear operation:
    magento-cloud cc

    On-premises, run:

    bin/magento cache:flush

    Flushing removes cached configuration and application data that could otherwise reflect the pre-rotation state.

  7. Re-enable cron. Restore the Cloud scheduler or resume the on-premises crontab after the key change and cache flush have completed.
  8. Disable maintenance mode. Run:
    bin/magento maintenance:disable

    Then perform a controlled storefront and Admin smoke test, including a login and a transaction path appropriate to your environment.

Keep the maintenance window open long enough to complete any required data re-encryption and validation. The key change itself is not a substitute for re-encrypting every custom field that your modules maintain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What happens to sessions and users

Adobe states that rotation immediately invalidates all customer and administrator sessions, except integration users. Customers and administrators therefore have to log in again after the change. This is expected behavior, not evidence that the rotation failed.

Plan the user impact explicitly:

  • Display a maintenance notice that explains a sign-in will be required after service returns.
  • Tell customer-support and operations teams to expect a wave of authentication requests.
  • Ask administrators to close stale browser tabs and authenticate again after the maintenance page is removed.
  • Review integration accounts separately, because Adobe’s stated session invalidation exception applies to integration users.

Do not promise that carts, checkout state, or third-party browser sessions will behave exactly as before. The documented guarantee is session invalidation and renewed login for customers and administrators; other application state depends on the relevant module and storage design.

Re-encrypt data after the change

Changing the key does not mean every stored ciphertext has already been rewritten under the new key. Adobe documents a separate re-encryption command with two default re-encryptors:

bin/magento encryption:data:re-encrypt core_config_data sales_order_payment

The names identify the documented scopes:

Re-encryptor Data scope Why it matters
core_config_data Encrypted core configuration values Allows protected configuration to be read with the new key.
sales_order_payment Encrypted sales-order payment data covered by the built-in handler Updates documented payment-related ciphertext for the replacement key.

Run the command from the Magento application root after the key change, following the maintenance and scheduling controls required by your deployment. Validate that it completes without errors before declaring the operation finished.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Custom encrypted columns

Modules can store encrypted values in columns that are not covered by those two default re-encryptors. Adobe’s re-encryption guidance describes defining a custom re-encryptor based on its SimpleHandler pattern. The module owner must identify the column, the serialization or encoding format, and the code path that reads and writes the value before implementing that handler.

Do not copy the default command and assume it covers a custom table. Make an inventory of module-owned encrypted fields, add the appropriate custom configuration, and test the handler against a database copy before production. A field that remains encrypted with the old key can produce decryption failures even though the main rotation command succeeded.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common rotation problems

env.php is not writable

Stop before enabling a production change that cannot finish. Correct the deployment’s file ownership or permissions using your normal release procedure, then re-check writability. Avoid making the file broadly writable as a shortcut; the goal is controlled write access for the deployment or Magento command account.

The key-change command is missing

Run bin/magento list | grep encryption:key:change and confirm the command is being executed from the correct Magento root and release. A missing command usually means the deployed version does not provide the current CLI workflow or the application is not using the code you expected. Do not edit crypt.key manually on a live store to imitate the command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Jobs continue during maintenance

Maintenance mode alone does not stop cron. On Cloud, verify that ./vendor/bin/ece-tools cron:disable was applied; on-premises, pause every crontab or scheduler entry that can invoke Magento. If imports, queues, or payment jobs continue, stop and assess the database before retrying the rotation sequence.

Customers report forced logouts

That is the documented result of a successful rotation for customer and administrator sessions. Confirm that the maintenance window has ended and direct users to sign in again. Integration users are the stated exception.

Decryption errors appear after rotation

First verify that the new key was recorded securely and that the same env.php is present on every application node. Then confirm that the documented re-encryption command completed and investigate custom encrypted columns that require a SimpleHandler-based re-encryptor. If the store was restored or migrated, check that the key belonging to the data backup was not replaced by a different environment’s key.

Cached configuration behaves inconsistently

Complete the appropriate cache flush after changing the key: magento-cloud cc on Cloud or bin/magento cache:flush on-premises. In a multi-node deployment, ensure the updated configuration and cache state are available consistently before reopening traffic.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Managing the key over the store’s lifetime

Key management is a lifecycle responsibility, not a one-time installation task.

Backups and disaster recovery

Include the protected configuration and its secret-management record in disaster-recovery procedures, with access limited to authorized recovery personnel. A database backup without the matching key may contain ciphertext that cannot be read; a key without the corresponding data does not restore the store. Test recovery in an isolated environment without exposing the secret in logs.

Deployments and multiple environments

Keep environment secrets separate and make the source of each key explicit. Never commit a production key to a shared repository for convenience, and do not silently replace a restored environment’s key while its database still contains values encrypted under the original. Deployment automation should inject or provision env.php through a controlled secret process rather than generating a new key on every release.

Deciding when to rotate

Rotation is appropriate when the key may have been exposed, when a controlled security program requires replacement, or when recovery and ownership procedures call for a new secret. Because rotation invalidates user sessions and can require custom data work, schedule it with the same discipline as a schema or credential change. Record the date, operator, release, backup reference, re-encryption scope, and validation results without recording the secret itself in ordinary operational notes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical validation checklist

  • Configuration: The deployed app/etc/env.php contains the intended crypt.key, and the file is not tracked by source control.
  • Command result: bin/magento encryption:key:change completed without errors.
  • Cache: The platform-specific cache flush completed.
  • Data: bin/magento encryption:data:re-encrypt core_config_data sales_order_payment completed, and custom encrypted columns have an appropriate handler.
  • Scheduling: Cron was stopped during the change and restarted afterward.
  • Access: A customer and an administrator can authenticate again; support understands the expected session reset.
  • Recovery: The new key is stored in the approved secret-management process, and the recovery team knows where to retrieve it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.