PHPackages                             andretx33/cryptid - 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. andretx33/cryptid

ActiveLibrary[Security](/categories/security)

andretx33/cryptid
=================

Simple and secure ID obfuscation for Laravel — ideal for encrypting UUIDs and internal IDs in URLs and forms.

v1.1.4(1mo ago)01.0k↑13.3%MITPHPPHP ^8.1 || ^8.2 || ^8.3 || ^8.4

Since Jul 29Pushed 1mo agoCompare

[ Source](https://github.com/andretx33/cryptid)[ Packagist](https://packagist.org/packages/andretx33/cryptid)[ RSS](/packages/andretx33-cryptid/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

CryptID — Lightweight Encryption for Laravel
============================================

[](#cryptid--lightweight-encryption-for-laravel)

`CryptID` is a simple, URL-safe, and reversible encryption tool designed for Laravel applications. It protects identifiers like UUIDs and integer IDs from exposure in plaintext in URLs, forms, and requests — reducing the risk of enumeration and brute-force discovery of sequential IDs.

---

🔐 Why use CryptID?
------------------

[](#-why-use-cryptid)

- ✅ Short encrypted output (base64, URL-safe)
- ✅ AES-256-CBC secure symmetric encryption
- ✅ Full control over keys and IV
- ✅ Reversible (for internal use)
- ✅ No reliance on Laravel's long `Crypt::encryptString` output
- ✅ Protects URLs and form values

---

✨ Installation
--------------

[](#-installation)

```
composer require andretx33/cryptid
```

---

🧪 Usage
-------

[](#-usage)

```
use CryptId;

// Works with UUIDs, integers, or any strings
$encoded = CryptId::encode('1fe8120a-c64c-47db-8acb-02195b3074ed');
$decoded = CryptId::decode($encoded);

// Already-decoded UUIDs or integers are returned as-is
CryptId::decode('1fe8120a-c64c-47db-8acb-02195b3074ed'); // returns same
CryptId::decode('123'); // returns 123

// Malformed or plain values will not crash
CryptId::decode('this-is-not-valid') // returns original string

---

## 🔐 Security Notes

This package is optimized for **ID obfuscation** (e.g., UUIDs or numeric IDs in URLs/forms). It is **not meant for storing highly sensitive data** like credentials or credit cards unless you manually implement MAC or HMAC for integrity.

- IV is derived deterministically from a secret
- AES-256-CBC is used with keys hashed from secrets
- Output is base64-encoded and URL-safe
- Integrity (tamper protection) is not built-in — use HTTPS and transport-layer protections

---

## 📄 License

MIT © [TX33](https://github.com/andretx33)
---

## ⚙️ Environment Setup

In your Laravel `.env` file, add:

```dotenv
CRYPTID_SECRET_KEY=your-secret-key-here
CRYPTID_SECRET_IV=your-secret-iv-here
```

These values are used internally to derive the encryption key and IV. Keep them secret!

#### ➕ E adicionar nova seção ao final do README:

[](#-e-adicionar-nova-seção-ao-final-do-readme)

```
---

## 🚀 v1.1.0 Highlights

- `CryptId::decode()` is now **tolerant and safe**.
- Accepts UUIDs, integer IDs, and malformed input without throwing exceptions.
- Useful when receiving input from multiple sources (URLs, forms, APIs).
- Great for public-facing APIs that need graceful fallback behavior.
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance92

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Recently: every ~86 days

Total

6

Last Release

39d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.1.3PHP ^8.1 || ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/170979818?v=4)[AF33](/maintainers/andretx33)[@andretx33](https://github.com/andretx33)

---

Top Contributors

[![tradepar-rgb](https://avatars.githubusercontent.com/u/281538822?v=4)](https://github.com/tradepar-rgb "tradepar-rgb (4 commits)")

### Embed Badge

![Health badge](/badges/andretx33-cryptid/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[illuminate/encryption

The Illuminate Encryption package.

9631.1M359](/packages/illuminate-encryption)

PHPackages © 2026

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