PHPackages                             dopecode/dcrypt - 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. dopecode/dcrypt

Abandoned → [mmeyer2k/dcrypt](/?search=mmeyer2k%2Fdcrypt)Library[Security](/categories/security)

dopecode/dcrypt
===============

A petite library of encryption functionality for PHP

13.2.0(4y ago)974718MITPHPPHP &gt;=7.1.0

Since Jun 30Pushed 2y ago4 watchersCompare

[ Source](https://github.com/mmeyer2k/dcrypt)[ Packagist](https://packagist.org/packages/dopecode/dcrypt)[ RSS](/packages/dopecode-dcrypt/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)DependenciesVersions (50)Used By (0)

🔐dcrypt
=======

[](#closed_lock_with_keydcrypt)

[![Build Status](https://camo.githubusercontent.com/d419f7fe8a3ee2643a3b21ee471fe09e9a4caea1e7a27cfae189448a51dbf4a9/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6d65796572326b2f6463727970742f747265652f6d61737465722e7376673f7374796c653d736869656c64)](https://circleci.com/gh/mmeyer2k/dcrypt)[![Code Coverage](https://camo.githubusercontent.com/48303af864deb6427191ff6fb16fcd38c6dd2c24f4c0e7dbae65625d99a7bab2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6d65796572326b2f6463727970742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mmeyer2k/dcrypt/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dbcbb3aebb44f7d78318b93caadba30b3ea3a729abbd6c85ae0079a8a9381d83/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6d65796572326b2f6463727970742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mmeyer2k/dcrypt/?branch=master)[![Code Climate GPA](https://camo.githubusercontent.com/cf31e95e023c25d101c3688d56aa913167448df0e1a92f8916dee8a77417d37d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d6d65796572326b2f6463727970742f6261646765732f6770612e737667)](https://codeclimate.com/github/mmeyer2k/dcrypt)[![License](https://camo.githubusercontent.com/3b1976e0028b565e395976d559a0cbaa0840337190376e8d53a2fdaecdac5d8c/68747470733a2f2f706f7365722e707567782e6f72672f6d6d65796572326b2f6463727970742f6c6963656e73652e737667)](https://packagist.org/packages/mmeyer2k/dcrypt)[![Latest Stable Version](https://camo.githubusercontent.com/44c920e4cae5acd53202e5fd48997cfc716349bdcf6963dc8224a66125d00674/68747470733a2f2f706f7365722e707567782e6f72672f6d6d65796572326b2f6463727970742f76657273696f6e)](https://packagist.org/packages/mmeyer2k/dcrypt)

A petite library of essential encryption functions for PHP 7.1+. For legacy PHP version support, look [here](https://github.com/mmeyer2k/dcrypt/blob/master/docs/LEGACY.md).

Install
=======

[](#install)

Add dcrypt to your composer.json file requirements. Don't worry, dcrypt does not have any dependencies of its own.

```
composer require "mmeyer2k/dcrypt:^13.2"
```

Block Ciphers
-------------

[](#block-ciphers)

The dcrypt library helps application developers avoid common mistakes in crypto implementations that leave data at risk.

[Specification document](https://github.com/mmeyer2k/dcrypt/blob/master/docs/CRYPTO.md)

### Keys

[](#keys)

Safe usage of dcrypt's block cipher functions requires the use of a high entropy 256 bit (minimum) key. Keys should be passed into dcrypt in *base64* encoded format. **You are responsible for the randomness of your key!**

Generate a new key on the linux CLI:

```
head -c 32 /dev/urandom | base64 -w 0 | xargs echo
```

Or with PHP...

```
