PHPackages                             hawk-hhg/hawki-crypto - 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. hawk-hhg/hawki-crypto

ActiveLibrary[Security](/categories/security)

hawk-hhg/hawki-crypto
=====================

The shared cryptographic module of HAWKI, providing secure encryption and decryption functionalities.

0.5.3(12mo ago)01.3k1MITShellPHP ^8.2CI passing

Since Jul 8Pushed 12mo agoCompare

[ Source](https://github.com/hawk-digital-environments/hawki-crypto)[ Packagist](https://packagist.org/packages/hawk-hhg/hawki-crypto)[ RSS](/packages/hawk-hhg-hawki-crypto/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (10)Used By (1)

HAWKI Crypto PHP
================

[](#hawki-crypto-php)

A PHP library for cryptographic operations including symmetric, asymmetric, and hybrid encryption/decryption.

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

[](#installation)

```
composer require hawk-hhg/hawki-crypto
```

Features
--------

[](#features)

- **Symmetric Cryptography**: Encrypt and decrypt data using a shared secret key
- **Asymmetric Cryptography**: Public/private key encryption for secure communication
- **Hybrid Cryptography**: Combines symmetric and asymmetric approaches for efficient secure communication

Usage
-----

[](#usage)

### Symmetric Encryption

[](#symmetric-encryption)

```
use Hawk\HawkiCrypto\SymmetricCrypto;

// Create instance
$crypto = new SymmetricCrypto();

// Encrypt data
$encrypted = $crypto->encrypt("sensitive data", "your-secret-key");

// Decrypt data
$decrypted = $crypto->decrypt($encrypted, "your-secret-key");
```

### Asymmetric Encryption

[](#asymmetric-encryption)

```
use Hawk\HawkiCrypto\AsymmetricCrypto;
use Hawk\HawkiCrypto\Value\AsymmetricKeypair;

// Create instance
$crypto = new AsymmetricCrypto();

// Generate keypair
$keypair = $crypto->generateKeypair();

// Encrypt with public key
$encrypted = $crypto->encrypt("sensitive data", $keypair->getPublicKey());

// Decrypt with private key
$decrypted = $crypto->decrypt($encrypted, $keypair);
```

### Hybrid Encryption

[](#hybrid-encryption)

```
use Hawk\HawkiCrypto\HybridCrypto;
use Hawk\HawkiCrypto\SymmetricCrypto;
use Hawk\HawkiCrypto\AsymmetricCrypto;
use Hawk\HawkiCrypto\Value\AsymmetricKeypair;

// Create required instances
$hybridCrypto = new HybridCrypto(new SymmetricCrypto(), new AsymmetricCrypto());

// Generate keypair
$keypair = $asymmetricCrypto->generateKeypair();

// Encrypt with public key
$encrypted = $hybridCrypto->encrypt("sensitive data", $keypair->getPublicKey());

// Decrypt with private key
$decrypted = $hybridCrypto->decrypt($encrypted, $keypair);
```

Value Objects
-------------

[](#value-objects)

The library provides several value objects for handling cryptographic operations:

- `AsymmetricKeypair`: Represents a public/private key pair
- `AsymmetricPublicKey`: Represents a public key
- `SymmetricCryptoValue`: Encapsulates symmetrically encrypted data
- `HybridCryptoValue`: Encapsulates hybrid encrypted data

All value objects can be serialized as JSON strings for easy storage and transmission like so:

```
use Hawk\HawkiCrypto\AsymmetricCrypto;

$crypto = new AsymmetricCrypto();

echo json_encode($crypto->generateKeypair()); // Outputs JSON representation of the keypair
```

Alternatively every value object can be cast into a string and recreated from it:

```
use Hawk\HawkiCrypto\AsymmetricCrypto;

$crypto = new AsymmetricCrypto();
$keypair = $crypto->generateKeypair();

echo (string) $keypair; // Outputs string representation of the keypair

$keypairFromString = AsymmetricKeypair::fromString((string) $keypair); // Recreates keypair from string
```

Exception Handling
------------------

[](#exception-handling)

The library throws exceptions that implement `HawkiCryptoExceptionInterface` when errors occur.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

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

Total

9

Last Release

360d ago

### Community

Maintainers

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

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

---

Top Contributors

[![Neunerlei](https://avatars.githubusercontent.com/u/22350956?v=4)](https://github.com/Neunerlei "Neunerlei (18 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hawk-hhg-hawki-crypto/health.svg)

```
[![Health](https://phpackages.com/badges/hawk-hhg-hawki-crypto/health.svg)](https://phpackages.com/packages/hawk-hhg-hawki-crypto)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M887](/packages/laravel-socialite)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M576](/packages/shopware-core)[singpolyma/openpgp-php

Pure-PHP implementation of the OpenPGP Message Format (RFC 4880)

182887.5k16](/packages/singpolyma-openpgp-php)[shopware/administration

Administration frontend for the Shopware Core

414.3M116](/packages/shopware-administration)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)

PHPackages © 2026

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