PHPackages                             jmrashed/laravel-cryptographic-signatures - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jmrashed/laravel-cryptographic-signatures

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jmrashed/laravel-cryptographic-signatures
=========================================

A Laravel package for cryptographic signature generation and verification.

v1.0.5(1y ago)08MITPHPPHP ^8.0

Since Feb 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jmrashed/laravel-cryptographic-signatures)[ Packagist](https://packagist.org/packages/jmrashed/laravel-cryptographic-signatures)[ RSS](/packages/jmrashed-laravel-cryptographic-signatures/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Cryptographic Signatures
================================

[](#laravel-cryptographic-signatures)

A Laravel package for generating and verifying cryptographic signatures using RSA keys. This package provides easy-to-use methods for securing your data through signatures, ensuring authenticity and integrity.

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

[](#installation)

You can install the package via Composer by running the following command in your Laravel project:

```
composer require jmrashed/laravel-cryptographic-signatures
```

### Publishing Configuration

[](#publishing-configuration)

Publish the package's configuration file to customize your keys:

```
php artisan vendor:publish --provider="Jmrashed\LaravelCryptographicSignatures\Providers\CryptoSignaturesServiceProvider" --tag="config"
```

This will create a `cryptosignature.php` file in the `config/` directory, where you can specify the paths to your private and public keys.

### Configuration

[](#configuration)

In your `.env` file, set the paths to your private and public keys:

```
CRYPTO_PRIVATE_KEY=storage/keys/private.key
CRYPTO_PUBLIC_KEY=storage/keys/public.key
```

How to generate RSA keys: storage/keys/private.key and storage/keys/public.key

```
openssl genrsa -out storage/keys/private.key 2048
openssl rsa -in storage/keys/private.key -pubout -out storage/keys/public.key
```

Make sure your keys are stored securely in the specified paths.

### How to publish config and keys

[](#how-to-publish-config-and-keys)

```
php artisan vendor:publish --provider="Jmrashed\LaravelCryptographicSignatures\Providers\CryptoSignaturesServiceProvider" --tag="config"
php artisan vendor:publish --provider="Jmrashed\LaravelCryptographicSignatures\Providers\CryptoSignaturesServiceProvider" --tag="keys"
```

Usage
-----

[](#usage)

Once the package is installed and configured, you can easily generate and verify cryptographic signatures.

### Generating a Signature

[](#generating-a-signature)

Use the `CryptoSignature` facade to generate a signature for your data.

```
use Jmrashed\LaravelCryptographicSignatures\Facades\CryptoSignature;

$data = 'Sensitive data to be signed';
$signature = CryptoSignature::generateSignature($data);

echo "Generated Signature: " . $signature;
```

### Verifying a Signature

[](#verifying-a-signature)

You can also verify a signature to ensure the integrity and authenticity of the data.

```
use Jmrashed\LaravelCryptographicSignatures\Facades\CryptoSignature;

$data = 'Sensitive data to be verified';
$signature = 'previouslyGeneratedSignature';

$isVerified = CryptoSignature::verifySignature($data, $signature);

if ($isVerified) {
    echo "The signature is valid!";
} else {
    echo "The signature is invalid!";
}
```

Features
--------

[](#features)

- **Generate cryptographic signatures**: Safely sign your data with a private key.
- **Verify signatures**: Ensure the authenticity and integrity of data with a public key.
- **Flexible configuration**: Easily set custom key paths through Laravel’s config system.

Example
-------

[](#example)

Here’s a complete example that demonstrates generating and verifying a signature:

```
use Jmrashed\LaravelCryptographicSignatures\Facades\CryptoSignature;

$data = 'Sensitive data to be signed';

// Generate the signature
$signature = CryptoSignature::generateSignature($data);

// Verify the signature
$isVerified = CryptoSignature::verifySignature($data, $signature);

if ($isVerified) {
    echo "The data is verified!";
} else {
    echo "Signature verification failed!";
}
```

Testing
-------

[](#testing)

To run tests for the package, use the following command:

```
php artisan test
```

Make sure your keys are properly configured in the `.env` file before running the tests.

License
-------

[](#license)

The package is open-sourced software licensed under the [MIT license](LICENSE).

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

[](#contributing)

Contributions are welcome! Please feel free to fork the repository, submit issues, and send pull requests.

- Fork the repo and clone it to your local machine
- Create a new branch for your changes
- Write tests for new features or bug fixes
- Submit a pull request with a description of your changes

Support
-------

[](#support)

If you encounter any issues or have questions, feel free to open an issue in the GitHub repository.

Acknowledgments
---------------

[](#acknowledgments)

- Thanks to Laravel for its amazing framework that makes building packages so easy!
- OpenSSL for providing secure cryptographic tools that power this package.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance43

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

6

Last Release

452d ago

PHP version history (2 changes)v1.0.0PHP ^7.4|^8.0

v1.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/12aeaba318c81d8e123faa3b8961a4e8a1ebf876e2a73b1e1ad08b3e5fc2f901?d=identicon)[jmrashed](/maintainers/jmrashed)

---

Top Contributors

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

---

Tags

laravelsecuritycryptographysignatureAuthentication

### Embed Badge

![Health badge](/badges/jmrashed-laravel-cryptographic-signatures/health.svg)

```
[![Health](https://phpackages.com/badges/jmrashed-laravel-cryptographic-signatures/health.svg)](https://phpackages.com/packages/jmrashed-laravel-cryptographic-signatures)
```

###  Alternatives

[salehhashemi/laravel-otp-manager

Laravel OTP manager

18713.2k](/packages/salehhashemi-laravel-otp-manager)[efficiently/authority-controller

AuthorityController is an PHP authorization library for Laravel 5 which restricts what resources a given user is allowed to access.

15533.2k](/packages/efficiently-authority-controller)[rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest API for developers and a strong authentication platform for the enterprise.

3376.7k1](/packages/rinvex-laravel-authy)[virgil/crypto

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

3618.0k2](/packages/virgil-crypto)[hosseinhezami/laravel-permission-manager

Advanced permission manager for Laravel.

403.3k](/packages/hosseinhezami-laravel-permission-manager)[virgil/sdk

Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to get preview access to our key infrastructure.

1016.3k](/packages/virgil-sdk)

PHPackages © 2026

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