PHPackages                             paperscissorsandglue/laravel-encryption-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. paperscissorsandglue/laravel-encryption-at-rest

ActiveLibrary[Security](/categories/security)

paperscissorsandglue/laravel-encryption-at-rest
===============================================

Laravel package for encrypting sensitive data at rest and decrypting it when in use - useful for GDPR, HIPAA, and other compliance requirements

v0.2.0(9mo ago)34111MITPHPPHP ^8.1CI passing

Since Jul 29Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/paperscissors/Laravel-Encryption-At-Rest)[ Packagist](https://packagist.org/packages/paperscissorsandglue/laravel-encryption-at-rest)[ RSS](/packages/paperscissorsandglue-laravel-encryption-at-rest/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Encryption at Rest
==========================

[](#laravel-encryption-at-rest)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2f5caed9182f56fc8cc021e72bd839c544c1b85623943035040036f3772c2fc3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706170657273636973736f7273616e64676c75652f6c61726176656c2d656e6372797074696f6e2d61742d726573742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paperscissorsandglue/laravel-encryption-at-rest)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ff4b62b570a163484eac5651521803cac9775535e2bb912c18d7d30594a66875/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706170657273636973736f7273616e64676c75652f6c61726176656c2d656e6372797074696f6e2d61742d726573742f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/paperscissorsandglue/laravel-encryption-at-rest/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/2b6c9c861907a7b3837490135e8f394618ece43b92a803f2a0b40ce37c38d160/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706170657273636973736f7273616e64676c75652f6c61726176656c2d656e6372797074696f6e2d61742d726573742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paperscissorsandglue/laravel-encryption-at-rest)[![License](https://camo.githubusercontent.com/ea09dfb8859d9643162db02133aa296483844fd32ef779ac5569cae20abd1d9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706170657273636973736f7273616e64676c75652f6c61726176656c2d656e6372797074696f6e2d61742d726573742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paperscissorsandglue/laravel-encryption-at-rest)

A Laravel package for encrypting sensitive data at rest and automatically decrypting it when in use. Useful for regulatory compliance requirements like GDPR, HIPAA, and other data protection standards. Compatible with Laravel 10, 11, and 12.

Features
--------

[](#features)

- ✅ Encrypt user identifiable data at rest and decrypt while being used
- ✅ Encrypt specific fields within JSON columns
- ✅ Special handling for email addresses with searchable indexes
- ✅ Seamless integration with Laravel's authentication system
- ✅ Compatible with Laravel notifications and other subsystems
- ✅ Command-line tools for migrating existing data
- ✅ Simple trait-based implementation for models

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require paperscissorsandglue/laravel-encryption-at-rest
```

After installation, publish the configuration file:

```
php artisan vendor:publish --tag=encryption-at-rest-config
```

Configuration
-------------

[](#configuration)

In your `.env` file, you can optionally set a custom encryption key:

```
ENCRYPTION_AT_REST_KEY=your-secure-key-here

```

If not set, the package will use your application key for encryption.

Basic Usage
-----------

[](#basic-usage)

Add the `Encryptable` trait to your model and define which attributes should be encrypted:

```
