PHPackages                             blar/openssl - 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. blar/openssl

ActiveLibrary

blar/openssl
============

OpenSSL for PHP

126210PHP

Since Sep 13Pushed 6y ago2 watchersCompare

[ Source](https://github.com/blar/openssl)[ Packagist](https://packagist.org/packages/blar/openssl)[ RSS](/packages/blar-openssl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![License](https://camo.githubusercontent.com/71b85099fbc18e9ac7e172f2db6dc7234d05ddba3f638c9ac09a7996250f67b2/68747470733a2f2f706f7365722e707567782e6f72672f626c61722f6f70656e73736c2f6c6963656e7365)](https://packagist.org/packages/blar/openssl)[![Latest Stable Version](https://camo.githubusercontent.com/10ef6aa0c92297c178e7aef1122628952ca3929f24ce59f07bca24c73981e55f/68747470733a2f2f706f7365722e707567782e6f72672f626c61722f6f70656e73736c2f762f737461626c65)](https://packagist.org/packages/blar/openssl)[![Build Status](https://camo.githubusercontent.com/0f65d6fc06c0b4ce8516d2b759af2adeffef04dbe5b79d3480c6b45727054b46/68747470733a2f2f7472617669732d63692e6f72672f626c61722f6f70656e73736c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/blar/openssl)[![Coverage Status](https://camo.githubusercontent.com/43fc561688c1ce8d8bf9fe8667744a97a28c75e92bef081c764210197b827c70/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f626c61722f6f70656e73736c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/blar/openssl?branch=master)[![Dependency Status](https://camo.githubusercontent.com/2bb5797cf0203fde498258e2b01c5c3ba9a2176a4f181612c9a6380d4b9b7012/68747470733a2f2f67656d6e617369756d2e636f6d2f626c61722f6f70656e73736c2e737667)](https://gemnasium.com/blar/openssl)[![Flattr](https://camo.githubusercontent.com/41a1a68906b7f18eaf2c372bc091deadd3c688cc10a1db2ea9494180539265db/68747470733a2f2f627574746f6e2e666c617474722e636f6d2f666c617474722d62616467652d6c617267652e706e67)](https://flattr.com/submit/auto?user_id=Blar&url=https%3A%2F%2Fgithub.com%2Fblar%2Fopenssl)

OpenSSL for PHP
===============

[](#openssl-for-php)

Examples
--------

[](#examples)

### Private Key

[](#private-key)

#### Create a new private key

[](#create-a-new-private-key)

```
$generator = new KeyGenerator();
$privateKey = $generator->generate();

```

#### Create a new private key with 2048 bit

[](#create-a-new-private-key-with-2048-bit)

```
$generator = new KeyGenerator();
$generator->setBits(2048);
$privateKey = $generator->generate();

```

#### Load an existing private key from file

[](#load-an-existing-private-key-from-file)

```
$privateKey = PrivateKey::loadFromFileName('privatekey.pem');

```

### Encrypt data with the private key.

[](#encrypt-data-with-the-private-key)

```
$encrypted = $privateKey->encrypt('Hello World');

```

### Get public key from private key.

[](#get-public-key-from-private-key)

```
$publicKey = $privateKey->getPublicKey();

```

### Decrypt data with the public key

[](#decrypt-data-with-the-public-key)

```
$publicKey->decrypt($encrypted);

```

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

[](#installation)

### Dependencies

[](#dependencies)

[Show dependencies of blar/openssl on gemnasium](https://gemnasium.com/blar/openssl)

### Installation per Composer

[](#installation-per-composer)

```
$ composer require blar/openssl

```

### Installation per Git

[](#installation-per-git)

```
$ git clone https://github.com/blar/openssl.git

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity36

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://avatars.githubusercontent.com/u/111508?v=4)[Andreas Treichel](/maintainers/blar)[@blar](https://github.com/blar)

---

Top Contributors

[![blar](https://avatars.githubusercontent.com/u/111508?v=4)](https://github.com/blar "blar (17 commits)")

---

Tags

opensslphp

### Embed Badge

![Health badge](/badges/blar-openssl/health.svg)

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

PHPackages © 2026

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