2017 © Pedro Peláez
 

library iron-php

A PHP port of hueniverse/iron

image

jsq/iron-php

A PHP port of hueniverse/iron

  • Monday, May 23, 2016
  • by jeskew
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,174 Installations
  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 16 % Grown

The README.md

iron-php

Build Status Scrutinizer Code Quality Apache 2 License Total Downloads Author, (*1)

iron-php is a PHP implementation of the Iron library. Iron generates encapsulated tokens suitable for embedding in cookies, query parameters, and HTTP headers., (*2)

$ composer require jsq/iron-php

Please consult the Iron [security considerations] (https://github.com/hueniverse/iron#security-considerations) before using this library., (*3)

Differences from Iron

iron-php supports the token format generated by Iron 4.0, with the following exceptions:, (*4)

  • The payload encryption cipher method is configurable but cannot be set to any GCM or CTR variant of AES. This is due to a PHP limitation that will be addressed in PHP 7.1.
  • Separate encryption and signature passwords are not supported.

Usage

<?php

use Jsq\Iron;
use Jsq\Iron\Password;

// payloads can be anything that can be serialized by json_encode
$payload = ['an' => 'array']; 
// passwords must be at least 32 characters long
$password = base64_encode(openssl_random_pseudo_bytes(24));
// tokens can be set to expire after a fixed number of seconds
$ttl = 300;

// create a sealed token
$token = Iron\seal($payload, $password, $ttl);

// The token will be unsealable with the correct password until the token expires
$unsealed = Iron\unseal($token, $password);


// Named passwords can also be used
$password = new Password(base64_encode(openssl_random_pseudo_bytes(24)), 'my_password');

// create a sealed token with the named password
$token = Iron\seal($payload, $password);

The Versions

23/05 2016

dev-master

9999999-dev

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=7.0

 

The Development Requires

by Jonathan Eskew

23/05 2016

0.4.0

0.4.0.0

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=7.0

 

The Development Requires

by Jonathan Eskew

02/05 2016

0.3.0

0.3.0.0

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=7.0

 

The Development Requires

by Jonathan Eskew

20/03 2016

0.2.0

0.2.0.0

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=5.5

 

The Development Requires

by Jonathan Eskew

20/03 2016

dev-feature/constant-time-checksum-comparison

dev-feature/constant-time-checksum-comparison

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=5.5

 

The Development Requires

by Jonathan Eskew

21/02 2016

0.1.1

0.1.1.0

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=5.5

 

The Development Requires

by Jonathan Eskew

21/02 2016

0.1.0

0.1.0.0

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=5.5

 

The Development Requires

by Jonathan Eskew

20/02 2016

0.0.1

0.0.1.0

A PHP port of hueniverse/iron

  Sources   Download

Apache-2.0

The Requires

  • ext-openssl *
  • php >=5.5

 

The Development Requires

by Jonathan Eskew