PHPackages                             jsnlib/codeigniter\_encryption - 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. jsnlib/codeigniter\_encryption

ActiveLibrary

jsnlib/codeigniter\_encryption
==============================

1.0.2(8y ago)114MITPHPPHP &gt;=7.1.0

Since Mar 7Pushed 8y agoCompare

[ Source](https://github.com/fdjkgh580/jsnlib-codeigniter_encryption)[ Packagist](https://packagist.org/packages/jsnlib/codeigniter_encryption)[ RSS](/packages/jsnlib-codeigniter-encryption/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Encryption
==========

[](#encryption)

範例
--

[](#範例)

```
class Welcome extends CI_Controller {

    public function index()
    {
        // 1. 使用 encryption 類別
        $this->load->library('encryption');

        // 2. 初始化並在建構子置入 CI 原生的 encryption 物件
        $this->jsnlib_ecp = new \Jsnlib\Codeigniter\Encryption($this->encryption);

        // 3. 產生加密字串
        $token = $this->jsnlib_ecp->encrypt(
        [
            'name' => 'Jason',
            'age' => 18,
            'expiry' => '2019-01-01 10:00:00' //若不指定過期時間，將自動添加預設值
        ]);

        // 4. 解密字串
        $ary = $this->jsnlib_ecp->decrypt($token);
    }

}
```

說明
--

[](#說明)

### encrypt(array $param): string

[](#encryptarray-param-string)

@param expiry 若不指定過期時間，將自動添加預設值

@return 將加密過的資料以 base64 的格式輸出

### decrypt(string $encrypt): array

[](#decryptstring-encrypt-array)

@param encrypt 加密的文字

@return is\_expired 是否已經過期

@return data 加密前的原始資料

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

2970d ago

### Community

Maintainers

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

---

Top Contributors

[![fdjkgh580-2](https://avatars.githubusercontent.com/u/60056647?v=4)](https://github.com/fdjkgh580-2 "fdjkgh580-2 (6 commits)")

### Embed Badge

![Health badge](/badges/jsnlib-codeigniter-encryption/health.svg)

```
[![Health](https://phpackages.com/badges/jsnlib-codeigniter-encryption/health.svg)](https://phpackages.com/packages/jsnlib-codeigniter-encryption)
```

PHPackages © 2026

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