Skip to content

Encryption ​

Chevereto uses ChaCha20 algorithm to cipher secrets and sensitive data. When enabled, Chevereto will store these values encrypted in the database.

Requires manual update

Encryption in Chevereto was added in v4.0.0-beta.10. If you installed Chevereto prior to this release you will require to manually enable encryption.

What is encrypted? ​

Settings secrets ​

The following settings are encrypted in the database:

SettingKey
API V1 key (public)api_v1_key
Email SMTP serveremail_smtp_server
Email SMTP portemail_smtp_server_port
Email SMTP usernameemail_smtp_server_username
Email SMTP passwordemail_smtp_server_password
AhaSend API keyemail_ahasend_api_key
Amazon SES access keyemail_ses_access_key
Amazon SES secret keyemail_ses_secret_key
Azure resource nameemail_azure_resource_name
Azure keyemail_azure_key
Brevo API keyemail_brevo_api_key
Infobip API keyemail_infobip_api_key
Infobip base URLemail_infobip_base_url
Mailgun API keyemail_mailgun_api_key
Mailgun domainemail_mailgun_domain
Mailjet access keyemail_mailjet_access_key
Mailjet secret keyemail_mailjet_secret_key
Mailomat API keyemail_mailomat_api_key
MailPace API tokenemail_mailpace_api_token
MailerSend API keyemail_mailersend_api_key
Mailtrap API tokenemail_mailtrap_api_token
Mandrill API keyemail_mandrill_api_key
Microsoft Graph client IDemail_microsoftgraph_client_id
Microsoft Graph client secretemail_microsoftgraph_client_secret
Microsoft Graph tenant IDemail_microsoftgraph_tenant_id
Postal API keyemail_postal_api_key
Postal base URLemail_postal_base_url
Postmark API tokenemail_postmark_api_token
Resend API keyemail_resend_api_key
Scaleway project IDemail_scaleway_project_id
Scaleway API keyemail_scaleway_api_key
SendGrid API keyemail_sendgrid_api_key
Sweego API keyemail_sweego_api_key
reCAPTCHA secret keycaptcha_secret
Disqus secret keydisqus_secret_key
Akismet API keyakismet_api_key
ModerateContent API Keymoderatecontent_key
Project Arachnid API Usernamearachnid_api_username
Project Arachnid API Passwordarachnid_api_password
Asset storage keyasset_storage_key
Asset storage secretasset_storage_secret
Asset storage bucketasset_storage_bucket

Album credentials ​

The following album column for chv_albums is encrypted in the database:

  • password

Storage credentials ​

The following storage columns for chv_storages are encrypted in the database:

  • server
  • service
  • account_id
  • account_name
  • key
  • secret
  • bucket

Two-factor secrets ​

Two-factor secret codes used to generate TOTP are encrypted in the database. Table chv_two_factors.

Variables secrets ​

The following values for chv_variables are encrypted in the database:

  • hmac_secret_token
  • hmac_secret_upload
  • hmac_secret_api_key

Key ​

The encryption key is base64 encoded random string of size 32. To generate a key use openssl:

sh
openssl rand -base64 32

Key security ​

Handle the encryption key with the same discretion of a password.

  • The encryption key should remain private.
  • Don't re-use the same key in different installations.
  • Backup the key in a safe location.

Enabling encryption ​

To enable encryption provide the CHEVERETO_ENCRYPTION_KEY environment variable.

This key is automatic provided on setup, stored in the app/env.php file.

From previous versions ​

Chevereto installations previous the introduction of encryption will require to manually cipher the existing data. This is a one time process that encrypts the plain text data stored in the database.

To manually enable encryption:

Disabling encryption ​

When disabling encryption all the cipher texts stored in the database will be reverted to its plain text value.

To disable encryption:

Released under the Apache-2.0 License.