PHPackages                             mmdm/sim-crypt - 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. mmdm/sim-crypt

ActiveLibrary[Security](/categories/security)

mmdm/sim-crypt
==============

A simple yet nice encryption/decryption library

v1.1.2(5y ago)1812MITPHPPHP &gt;=7.2

Since Jul 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mmdm95/sim-crypt)[ Packagist](https://packagist.org/packages/mmdm/sim-crypt)[ RSS](/packages/mmdm-sim-crypt/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (6)Used By (2)

Simplicity Crypt
================

[](#simplicity-crypt)

A library to encrypt/decrypt your data with two keys and two cipher methods.

Install
-------

[](#install)

**composer**

```
composer require mmdm/sim-crypt
```

Or you can simply download zip file from github and extract it, then put file to your project library and use it like other libraries.

Just add line below to autoload files:

```
require_once 'path_to_library/autoloader.php';
```

and you are good to go.

How to use
----------

[](#how-to-use)

```
// to instance a crypt object
$crypt = new Crypt($main_key, $assured_key);

// to crypt data
$encrypted_message = $crypt->encrypt("message to encrypt");

// to encrypt data
$decrypted_message = $crypt->decrypt($encrypted_message);

// "message to encrypt" will be equal to $decrypted_message at the end
```

### Description

[](#description)

To instantiate crypt object, you need two keys. One is the main key and the other is assured key. These keys must be base64 coded strings. You can build them using [this website](https://mypwd.net/). First generate strong passwords then use base64 encoder/decoder to make them as base64 coded strings and use them for library **or** you can choose two strings as password and use php function `base64_encode()`to make them base64.

Available functions
-------------------

[](#available-functions)

`setFirstEncryptionMethod(string $first_method)`

You can set first encryption method from valid encryption methods. See `openssl_get_cipher_methods()` PHP built-in function for supported methods.

`getFirstEncryptionMethod(): string`

Get first encryption method.

`setSecondEncryptionMethod(string $second_method)`

You can set second encryption method from valid encryption methods. See `openssl_get_cipher_methods()` PHP built-in function for supported methods.

`getSecondEncryptionMethod(): string`

Get second encryption method.

`encrypt($data): ?string`

This method encrypts a message and return encrypted value or `null` if $data is an empty string

```
$encrypted_message = $crypt->encrypt($message_to_encrypt);
```

`decrypt($data): ?string`

This method decrypts an encrypted message and return actual message or `null` if $data is an empty string or an error happened during decode step.

```
$decrypted_message = $crypt->decrypt($encrypted_message);
```

`hasError()`

This function return a boolean indicates operation has error or not.

Note: This method should call after encrypt or decrypt methods to take action on error occurrence.

```
$bool = $crypt->hasError(); // true on having error or false on OK
```

License
=======

[](#license)

Under MIT license.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~62 days

Total

5

Last Release

1906d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d955ebaae3fe602e6ad26c16422f6ab25a61a436fd7f08425a5be5c73ef9025c?d=identicon)[mmdm95](/maintainers/mmdm95)

---

Top Contributors

[![mmdm95](https://avatars.githubusercontent.com/u/26489185?v=4)](https://github.com/mmdm95 "mmdm95 (18 commits)")

### Embed Badge

![Health badge](/badges/mmdm-sim-crypt/health.svg)

```
[![Health](https://phpackages.com/badges/mmdm-sim-crypt/health.svg)](https://phpackages.com/packages/mmdm-sim-crypt)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M134](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k35](/packages/paragonie-ecc)[fof/recaptcha

Increase your forum's security with Google reCAPTCHA

1436.9k](/packages/fof-recaptcha)

PHPackages © 2026

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