PHPackages                             taitava/silverstripe-encrypt-at-rest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. taitava/silverstripe-encrypt-at-rest

ActiveSilverstripe-module[Security](/categories/security)

taitava/silverstripe-encrypt-at-rest
====================================

Enable encryption of data at rest (in database)

1.3.1(7y ago)0268WTFPLPHP

Since May 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Taitava/silverstripe-encrypt-at-rest)[ Packagist](https://packagist.org/packages/taitava/silverstripe-encrypt-at-rest)[ Docs](https://github.com/madmatt/silverstripe-encrypt-at-rest)[ RSS](/packages/taitava-silverstripe-encrypt-at-rest/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

IMPORTANT! Use madmatt/silverstripe-encrypt-at-rest instead of this one! This is just a fork with some new, untested features!
==============================================================================================================================

[](#important-use-madmattsilverstripe-encrypt-at-rest-instead-of-this-one-this-is-just-a-fork-with-some-new-untested-features)

silverstripe-encrypt-at-rest
============================

[](#silverstripe-encrypt-at-rest)

This module allows data to be encrypted in the database, but be decrypted when extracted from the database, using a secret key (hopefully) known only by the web server.

*Note:* This does not provide significant protection except in the case of database compromise. It should be used as part of a layered security strategy. This is because the key is still available on the web server, so if remote code execution is achieved by an attacker, they will be able to read both the database *and* the encryption key, thereby decrypting the content.

*Note:* This module is not yet ready for real use, it's currently v0.0.1 material.

Usage
-----

[](#usage)

In your DataObject, use EncryptedDBField, to have it encrypted. At this point, everything is stored as text.

Set a key in your `_ss_environment` file.

`define('ENCRYPT_AT_REST_KEY', 'mysupersecretlonghexkeyhere1234567890');`

### DataObject specific encryption keys

[](#dataobject-specific-encryption-keys)

Another, optional and advanced way to define the key is to create an optional method in your DataObject class:

```
class MyDataObject extends DataObject
{
    private static $db = array(
        'MyEncryptedField' => 'EncryptedText'
    );

    public function provideEncryptionKey($field_name, $field_type)
    {
        return *A custom key here*;
    }
}
```

This way you can have multiple keys and you are able to decide which key to use in which situation. You are allowed to return either a Defuse\\Crypto\\Key object or a plain string presentation of the key. You can also return just `null`, if you want to stick with the default key defined in the `ENCRYPT_AT_REST_KEY` constant. The latter is also used if you do not create the `provideEncryptionKey()` method at all.

`$field_name` and `$field_type` arguments can be used to get to know which field is being currently encrypted/decrypted. The latter argument tells the data type class of the field, for example `EncryptedText`.

TODO
----

[](#todo)

- Make sure $this-&gt;value is *always* the unencrypted value
- Clean up
- EncryptedEnum needs validation
- Extended testing
- Test if the value is actually encrypted, before trying to decrypt
-

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~319 days

Total

4

Last Release

2358d ago

Major Versions

0.3.1 → 1.3.12018-08-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/611d4d836f6db7ba7357ea174bf48ab8cf86af5ac40be4a7a6101e67267333f9?d=identicon)[taitava](/maintainers/taitava)

---

Top Contributors

[![Taitava](https://avatars.githubusercontent.com/u/13002142?v=4)](https://github.com/Taitava "Taitava (9 commits)")[![Firesphere](https://avatars.githubusercontent.com/u/680570?v=4)](https://github.com/Firesphere "Firesphere (8 commits)")[![madmatt](https://avatars.githubusercontent.com/u/893117?v=4)](https://github.com/madmatt "madmatt (6 commits)")[![steve-silverstripe](https://avatars.githubusercontent.com/u/16407791?v=4)](https://github.com/steve-silverstripe "steve-silverstripe (5 commits)")

---

Tags

encryptionsilverstripedecryptionencrypt-at-rest

### Embed Badge

![Health badge](/badges/taitava-silverstripe-encrypt-at-rest/health.svg)

```
[![Health](https://phpackages.com/badges/taitava-silverstripe-encrypt-at-rest/health.svg)](https://phpackages.com/packages/taitava-silverstripe-encrypt-at-rest)
```

###  Alternatives

[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

951.1M2](/packages/nzo-url-encryptor-bundle)[staabm/secure_dotenv

An encrypted environment configuration handler

101.0M](/packages/staabm-secure-dotenv)[camcima/dukpt-php

DUKPT implementation in PHP

25153.7k](/packages/camcima-dukpt-php)[mukto90/ncrypt

A simple PHP class to encrypt a string and decrypt an encrypted string

1613.8k](/packages/mukto90-ncrypt)[al-saloul/encryption

Simple number encryption and decryption package

181.4k](/packages/al-saloul-encryption)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
