PHPackages                             ramazancetinkaya/obscura - 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. ramazancetinkaya/obscura

ActiveLibrary[Security](/categories/security)

ramazancetinkaya/obscura
========================

A multi-round polynomial-based encryption layer on top of AES-256 for enhanced security, without requiring GMP.

1.0.0(1y ago)1421MITPHPPHP &gt;=8.0

Since Dec 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ramazancetinkaya/Obscura)[ Packagist](https://packagist.org/packages/ramazancetinkaya/obscura)[ RSS](/packages/ramazancetinkaya-obscura/feed)WikiDiscussions main Synced 1mo ago

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

Obscura - AES Cryptor
=====================

[](#obscura---aes-cryptor)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/2f6f9af2e917cbf5786673e8e4ed8d0d9b29be6131327a992063e69136a93411/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c7565)](https://www.php.net/)[![Issues](https://camo.githubusercontent.com/4ceea018d6d351b3ba1cfe6f9c9067c3c3f75a7318fab1336ea94672fe5d25c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f72616d617a616e636574696e6b6179612f4f62736375726143727970743f636f6c6f723d677265656e)](https://github.com/ramazancetinkaya/ObscuraCrypt/issues)[![Stars](https://camo.githubusercontent.com/5cc6e36bbc3b55c79f33c10fd45ea90f8d7f57416811114f0ac39efdd0bd4393/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f72616d617a616e636574696e6b6179612f4f62736375726143727970743f636f6c6f723d79656c6c6f77)](https://github.com/ramazancetinkaya/ObscuraCrypt/stargazers)[![Forks](https://camo.githubusercontent.com/89863905afc7c8381d716459682203b6480f0268e1d59b561b70802a1cf2276b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f72616d617a616e636574696e6b6179612f4f62736375726143727970743f636f6c6f723d6c6967687467726579)](https://github.com/ramazancetinkaya/ObscuraCrypt/network)

**Obscura** is an advanced PHP cryptography library that combines robust AES encryption (AES-256-CBC by default) with a multi-round polynomial-based custom encryption layer for enhanced security. It also supports URL-safe Base64 encoding when desired.

[Report a Bug](https://github.com/ramazancetinkaya/ObscuraCrypt/issues)· [New Pull Request](https://github.com/ramazancetinkaya/ObscuraCrypt/pulls)

> **No GMP extension needed** – everything is done via the **Extended Euclidean Algorithm** for modular arithmetic.

> **Disclaimer:** This code is presented for educational purposes. For production environments, ensure that you have conducted a thorough security review and implemented best practices for key management, tamper detection, and environment-specific compliance requirements.

⭐ Support the Project
---------------------

[](#-support-the-project)

If you find this library helpful, please consider giving it a star on GitHub. Your support helps improve and maintain the project. Thank you! 🌟

---

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
    - [Basic Example](#basic-example)
    - [URL-safe Base64 Example](#url-safe-base64-example)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- **AES-256-CBC**: Provides a strong, battle-tested encryption foundation via OpenSSL.
- **Multi-Round Custom Layer**: Applies multiple polynomial transformations on each character, making cryptanalysis more challenging.
- **No GMP Dependency**: Uses the Extended Euclidean Algorithm for modular inverse, so **GMP** is not required.
- **URL-Safe Base64 Option**: Encrypt once, share anywhere. Prevents `+`, `/`, and `=` characters from breaking URLs.
- **Strict Typing**: Leverages PHP 8.0+ features and enforces strict typing for reliability.
- **Custom Exceptions**: Throws a `CryptoException` for all encryption/decryption errors, making error handling straightforward.

Installation
------------

[](#installation)

You can install the `Obscura` library using [Composer](https://getcomposer.org/). Run the following command in your terminal:

```
composer require ramazancetinkaya/obscura
```

This command adds the library to your composer.json and installs it in the vendor/ directory.

Usage
-----

[](#usage)

Below are quick examples demonstrating how to use Obscura in your PHP project.

### Basic Example

[](#basic-example)

```
