PHPackages                             mukto90/ncrypt - 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. mukto90/ncrypt

ActiveLibrary[Security](/categories/security)

mukto90/ncrypt
==============

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

v1.0(8y ago)1613.3k↓32.6%4[1 issues](https://github.com/mukto90/ncrypt/issues)GPL-3.0-or-laterPHPPHP &gt;=5.3.0

Since May 15Pushed 6y ago2 watchersCompare

[ Source](https://github.com/mukto90/ncrypt)[ Packagist](https://packagist.org/packages/mukto90/ncrypt)[ Docs](https://github.com/mukto90/ncrypt)[ RSS](/packages/mukto90-ncrypt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Ncrypt : A 2-way encryption system
==================================

[](#ncrypt--a-2-way-encryption-system)

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

Steps
-----

[](#steps)

### Include the class

[](#include-the-class)

#### Option 1 (using Composer)

[](#option-1-using-composer)

- Add the following to your `composer.json` file-

```
{
    "require": {
        "mukto90/ncrypt": "dev-master"
    }
}
```

- Run `composer install` command.
- Include your autoloader file (if not already), like this-

```
include 'vendor/autoload.php';
```

#### Option 2

[](#option-2)

- Copy `class.ncrypt.php` file from `ncrypt/src/` directory to your project.
- Include the class in your project file, like this-

```
include 'src/class.ncrypt.php';
```

### Instantiate the class

[](#instantiate-the-class)

```
$ncrypt = new mukto90\Ncrypt;
```

### Configure (optional)

[](#configure-optional)

- Optionally set secret key, secret IV and cipher

```
$ncrypt->set_secret_key( '^&-my-key-&^' );  // optional, but STRONGLY recommended
$ncrypt->set_secret_iv( '#@)-my-iv-#*$' );  // optional, but STRONGLY recommended
$ncrypt->set_cipher( 'AES-256-CBC' );       // optional
```

### How to encrypt a plain text/string

[](#how-to-encrypt-a-plain-textstring)

- Pass your string to `encrypt()` method-

```
$encrypted = $ncrypt->encrypt( 'Hello World!' ); // output: SFpQVWk0WjFxdW5lSGFXaUdWUEx3Zz09
```

### How to decrypt an encrypted string

[](#how-to-decrypt-an-encrypted-string)

- Pass the already encrypted string to `decrypt()` method-

```
$decrypted = $ncrypt->decrypt( 'SFpQVWk0WjFxdW5lSGFXaUdWUEx3Zz09' ); // output: Hello World!
```

Requirement (minimum)
---------------------

[](#requirement-minimum)

- PHP 5.3.0
- `php_openssl` library needs to be enabled. [See here](http://php.net/manual/en/openssl.installation.php)

Author
------

[](#author)

[Nazmul Ahsan](https://nazmulahsan.me)

Discussion
----------

[](#discussion)

[Link](https://nazmulahsan.me/?p=570)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

2926d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5627157?v=4)[Nazmul Ahsan](/maintainers/mukto90)[@mukto90](https://github.com/mukto90)

---

Top Contributors

[![mukto90](https://avatars.githubusercontent.com/u/5627157?v=4)](https://github.com/mukto90 "mukto90 (6 commits)")

---

Tags

encryptiondecryptionencryption and decryption2 way encryption and decryption

### Embed Badge

![Health badge](/badges/mukto90-ncrypt/health.svg)

```
[![Health](https://phpackages.com/badges/mukto90-ncrypt/health.svg)](https://phpackages.com/packages/mukto90-ncrypt)
```

###  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

961.0M2](/packages/nzo-url-encryptor-bundle)[camcima/dukpt-php

DUKPT implementation in PHP

25153.1k](/packages/camcima-dukpt-php)[al-saloul/encryption

Simple number encryption and decryption package

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

PHPackages © 2026

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