2017 © Pedro Peláez
 

library authcode

Ecode and decode string.

image

wilon/authcode

Ecode and decode string.

  • Wednesday, August 16, 2017
  • by wilon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

wilon/authcode

Packagist ![Packagist Release][badge_release] Packagist Downloads, (*1)

PHP string Encryption and Decryption. From discuz source code., (*2)

Installation & loading

Just add this line to your composer.json file:, (*3)

"wilon/authcode": "^1.1.3"

or, (*4)

composer require wilon/authcode

A Simple Example

Encode & Decode
<?php

use Encryption\Authcode;

$key = 'IoUwe#(#FFFsfoaHFfa';
echo $auth = Authcode::encode('String', $key), '<br>';
echo $result = Authcode::decode($auth, $key), '<br>';
<?php

$key = 'IoUwe#(#FFFsfoaHFfa';
echo $auth = Encryption\Authcode::encode('String', $key), '<br>';
echo $result = Encryption\Authcode::decode($auth, $key), '<br>';
Only correct key can decode
<?php
$key = 'IoUwe#(#FFFsfoaHFfa';
echo $auth = Encryption\Authcode::encode('String', $key), '<br>';
echo $result2 = Encryption\Authcode::decode($auth, 'otherKey'), '<br>';    # Can't get 'String'
Use expiry
$key = 'IoUwe#(#FFFsfoaHFfa';
echo $auth = Encryption\Authcode::encode('String', $key, 10), '<br>';
sleep(11);
echo $result = Encryption\Authcode::decode($auth, $key), '<br>';    # Can't get 'String'
Encode remain equal signs

python without '=' base64.b64decode() can't decode, (*5)

<?php
echo $auth = Encryption\Authcode::encodeRemainEqualsigns('String', $key), '<br>';    # has '='
echo $result = Encryption\Authcode::decode($auth, $key), '<br>';

The Versions

16/08 2017

dev-master

9999999-dev https://wilon.github.io

Ecode and decode string.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

encrypt decode

14/03 2017

1.1.3

1.1.3.0 https://wilon.github.io

Ecode and decode string.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

encrypt decode

10/02 2017

1.1.2

1.1.2.0 https://wilon.github.io

Ecode and decode string.

  Sources   Download

MIT

The Requires

  • php >=5.2

 

encrypt decode

09/02 2017

1.1.1

1.1.1.0 https://wilon.github.io

Ecode and decode string.

  Sources   Download

MIT

The Requires

  • php >=5.2

 

encrypt decode

09/02 2017

1.1

1.1.0.0 https://wilon.github.io

Ecode and decode string.

  Sources   Download

MIT

The Requires

  • php >=5.2

 

encrypt decode

09/02 2017

1.0

1.0.0.0 https://wilon.github.io

Ecode and decode string.

  Sources   Download

MIT

The Requires

  • php >=5.2

 

encrypt decode