PHPackages                             abdelrhmankhodary/cybersec-utils-01 - 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. abdelrhmankhodary/cybersec-utils-01

ActiveLibrary[Security](/categories/security)

abdelrhmankhodary/cybersec-utils-01
===================================

A PHP library for essential cybersecurity utilities.

00PHP

Since Dec 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/abdelrhmankhodary/CyberSec-Utils)[ Packagist](https://packagist.org/packages/abdelrhmankhodary/cybersec-utils-01)[ RSS](/packages/abdelrhmankhodary-cybersec-utils-01/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CyberSec-Utils Library
======================

[](#cybersec-utils-library)

Overview
--------

[](#overview)

CyberSec-Utils is a PHP library providing utilities for cybersecurity-related operations such as encryption, hashing, token generation, and input validation. It is designed to simplify the implementation of secure and reliable functionality in PHP projects.

Features
--------

[](#features)

### Encryption

[](#encryption)

- Symmetric encryption using AES-256.

### Hashing

[](#hashing)

- Secure password hashing using `password_hash`.

### Token Generation

[](#token-generation)

- JSON Web Token (JWT) generation and validation.

### Validation

[](#validation)

- Input validation and sanitization for common use cases.

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- OpenSSL extension (for encryption)

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

[](#installation)

### Using Composer (Recommended)

[](#using-composer-recommended)

Add the library to your project:

```
composer require your-namespace/cybersec-utils

```

Include the Composer autoload file in your project:

```
require_once __DIR__ . '/vendor/autoload.php';
```

### Manual Installation

[](#manual-installation)

Clone the repository:

```
git clone https://github.com/your-repo/cybersec-utils.git

```

Include the library files manually:

```
require_once __DIR__ . '/src/Encryption/Symmetric.php';
require_once __DIR__ . '/src/Hashing/Password.php';
require_once __DIR__ . '/src/Tokens/JWT.php';
require_once __DIR__ . '/src/Validation/Validation.php';
```

Usage Examples
--------------

[](#usage-examples)

### Encryption

[](#encryption-1)

```
use CyberSec\Encryption\Symmetric;

$key = 'your-secret-key';
$data = 'Sensitive data';

$encrypted = Symmetric::encrypt($data, $key);
$decrypted = Symmetric::decrypt($encrypted, $key);

echo $decrypted; // Outputs: Sensitive data
```

### Password Hashing

[](#password-hashing)

```
use CyberSec\Hashing\Password;

$password = 'secure-password';
$hashedPassword = Password::hash($password);

if (Password::verify($password, $hashedPassword)) {
    echo 'Password is valid';
}
```

### JSON Web Tokens (JWT)

[](#json-web-tokens-jwt)

```
use CyberSec\Tokens\JWT;

$payload = ['user_id' => 123, 'role' => 'admin'];
$key = 'your-secret-key';

$token = JWT::generate($payload, $key);
$decoded = JWT::validate($token, $key);

print_r($decoded);
```

### Input Validation

[](#input-validation)

```
use CyberSec\Validation\Validation;

$email = 'test@example.com';
if (Validation::validateEmail($email)) {
    echo 'Valid email';
}

$sanitizedString = Validation::sanitizeString("Hello alert('hi');");
echo $sanitizedString; // Outputs: Hello
```

Running Tests
-------------

[](#running-tests)

To run unit tests:

1. Ensure PHPUnit is installed via Composer.
2. Execute the tests:

```
./vendor/bin/phpunit

```

Contributing
------------

[](#contributing)

1. Fork the repository.
2. Create a new feature branch:

```
git checkout -b feature-name

```

3. Commit your changes and push to the branch:

```
git push origin feature-name

```

4. Create a pull request.

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![abdelrhmankhodary](https://avatars.githubusercontent.com/u/96380574?v=4)](https://github.com/abdelrhmankhodary "abdelrhmankhodary (7 commits)")

### Embed Badge

![Health badge](/badges/abdelrhmankhodary-cybersec-utils-01/health.svg)

```
[![Health](https://phpackages.com/badges/abdelrhmankhodary-cybersec-utils-01/health.svg)](https://phpackages.com/packages/abdelrhmankhodary-cybersec-utils-01)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

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

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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