PHPackages                             trianglman/sqrl - 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. trianglman/sqrl

ActiveLibrary

trianglman/sqrl
===============

PHP Server side implementation of a SQRL generator/listener

9816917[7 issues](https://github.com/trianglman/sqrl/issues)PHP

Since Jul 17Pushed 6y ago36 watchersCompare

[ Source](https://github.com/trianglman/sqrl)[ Packagist](https://packagist.org/packages/trianglman/sqrl)[ RSS](/packages/trianglman-sqrl/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![](assets/sqrl_php_logo_150px.png)](assets/sqrl_php_logo_150px.png)

[![Build Status](https://camo.githubusercontent.com/6d5c03ea9cd51a39f3efe2552caae627f0ae5bddc90398f2fabc620ac3f3f5e7/68747470733a2f2f7472617669732d63692e6f72672f747269616e676c6d616e2f7371726c2e737667)](https://travis-ci.org/trianglman/sqrl)

sqrl
====

[](#sqrl)

PHP Server side implementation of a SQRL generator/listener

This project is in *pre-alpha* until there is a defined reference implementation.

Follow the conversation at [grc sqrl newsgroup](https://www.grc.com/groups/sqrl) for updates on the standard.

Software Requirements
---------------------

[](#software-requirements)

- Composer -
- Endroid/qrcode Loaded automatically by Composer -

Purpose
-------

[](#purpose)

The goal of this software is to provide a simple PHP implementation of Steve Gibson's SQRL authentication proposal. This library will allow any site using it to generate the QR code with a nonce, validate a signed nonce, and store the public key for connection to a site account.

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

[](#installation)

### Composer

[](#composer)

1. Download the [`composer.phar`](https://getcomposer.org/composer.phar) executable or use the installer.

    ```
    $ curl -sS https://getcomposer.org/installer | php
    ```
2. Create a composer.json defining your dependencies. Note that this example is a short version for applications that are not meant to be published as packages themselves. To create libraries/packages please read the [documentation](http://getcomposer.org/doc/02-libraries.md).

    ```
        "require": {
            "trianglman/sqrl": "dev-master"
        }
    ```
3. Run Composer: `php composer.phar update`

### Configuration

[](#configuration)

If you want to have the library automatically store generated nonces and validated public keys, first generate the database tables based on the supplied [ExampleStatefulStorage.php](examples/server/includes/ExampleStatefulStorage.php), then create a JSON config file based on the sample provided in sqrl/config.sample.json. You can then configure the generator or validator by calling the appropriate `configure($filepath);`method.

If you would rather manage storage of this information in your own tables, you can configure the generator manually:

```
$generator = new \Trianglman\Sqrl\SqrlGenerate();
//whether SQRL responses should come back over SSL (sqrl://)
$generator->setSecure(true);
//the domain sqrl clients should generate their key off of
$generator->setKeyDomain('www.example.com');
//the path to the SQRL authentication script relative to the key domain
$generator->setAuthenticationPath('sqrl/login.php');

//The above would generate a SQRL URL pointing to
//sqrl://www.example.com/sqrl/login.php
//...
```

You can also configure the size of the QR code generated and the amount of padding between the image edge and the start of the code, as well as supply your own salt for the nonce:

```
//...
$generator->setHeight(300);
$generator->setPadding(10);
$generator->setSalt('foo');
//...
```

### Usage

[](#usage)

**Generate a nonce**

```
//Initialize the generator
$generator = new \Trianglman\Sqrl\SqrlGenerate();
$generator->configure('/path/to/config');

//output the QR file to stdout
$generator->render();

//get the nonce for other uses, i.e. link, etc.
$nonce = $generator->getNonce();
```

**Verify a user's input**

```
//initialize the validator
$validator = new \Trianglman\Sqrl\SqrlValidate();
$validator->configure('/path/to/config');
$validator->setValidator(new \Trianglman\Sqrl\ed25519\Crypto());

//initialize the request handler
$requestResponse = new \Trianglman\Sqrl\SqrlRequestHandler($validator);
$requestResponse->parseRequest($_GET, $_POST, $_SERVER);

//check validation
$requestResponse = $obj->getResponseMessage();
$requestResponseCode = $obj->getResponseCode();

//OR

//Let the request handler also handle the response
$reqHandler->sendResponse();
```

Resources
=========

[](#resources)

- [GRC.com - SQRL Explainted](https://www.grc.com/sqrl/SQRL_Explained.pdf) (pdf)
- [GRC.com - SQRL Semantincs](https://www.grc.com/sqrl/semantics.htm)
- [GRC.com - SQRL Protocol](https://www.grc.com/sqrl/protocol.htm)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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/52e3a16e00deee8fad55014f01e9462ae1b0d53670180d6c815c3611ad7acd52?d=identicon)[drak](/maintainers/drak)

---

Top Contributors

[![trianglman](https://avatars.githubusercontent.com/u/1578567?v=4)](https://github.com/trianglman "trianglman (10 commits)")[![PohlmanUSA](https://avatars.githubusercontent.com/u/4760569?v=4)](https://github.com/PohlmanUSA "PohlmanUSA (7 commits)")[![roverwolf](https://avatars.githubusercontent.com/u/210211?v=4)](https://github.com/roverwolf "roverwolf (2 commits)")[![rwese](https://avatars.githubusercontent.com/u/7153716?v=4)](https://github.com/rwese "rwese (2 commits)")[![My1](https://avatars.githubusercontent.com/u/6696524?v=4)](https://github.com/My1 "My1 (1 commits)")[![atonsion](https://avatars.githubusercontent.com/u/44152514?v=4)](https://github.com/atonsion "atonsion (1 commits)")[![Dreckiger-Dan](https://avatars.githubusercontent.com/u/10210133?v=4)](https://github.com/Dreckiger-Dan "Dreckiger-Dan (1 commits)")

### Embed Badge

![Health badge](/badges/trianglman-sqrl/health.svg)

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

PHPackages © 2026

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