Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kelvinmo/fernet-php

An implementation of the Fernet token specification in PHP.
https://github.com/kelvinmo/fernet-php

fernet php

Last synced: 9 days ago
JSON representation

An implementation of the Fernet token specification in PHP.

Awesome Lists containing this project

README

        

# Fernet-PHP

[![Latest Stable Version](https://poser.pugx.org/kelvinmo/fernet-php/v/stable)](https://packagist.org/packages/kelvinmo/fernet-php)
[![Build Status](https://travis-ci.org/kelvinmo/fernet-php.svg?branch=master)](https://travis-ci.org/kelvinmo/fernet-php)

Fernet-PHP is an implementation of the [Fernet token specification](https://github.com/fernet/spec/blob/master/Spec.md)
in PHP.

## Requirements

- PHP 7.0 or later
- `hash` extension
- `openssl` or `mcrypt` extension
- `mbstring.func_overload` needs to be switched **off** in `php.ini`

## Installation

You can install via [Composer](http://getcomposer.org/).

```sh
composer require kelvinmo/fernet-php
```

## Usage

```php
encode('string message');

$message = $fernet->decode('fernet token');
if ($message === null) {
echo 'Token is not valid';
}

?>
```

## License

BSD 3 clause