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: about 1 year ago
JSON representation
An implementation of the Fernet token specification in PHP.
- Host: GitHub
- URL: https://github.com/kelvinmo/fernet-php
- Owner: kelvinmo
- License: other
- Created: 2015-01-01T23:32:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-02-22T07:19:17.000Z (over 4 years ago)
- Last Synced: 2025-04-15T23:08:04.684Z (about 1 year ago)
- Topics: fernet, php
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 21
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING.txt
Awesome Lists containing this project
README
# Fernet-PHP
[](https://packagist.org/packages/kelvinmo/fernet-php)
[](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