2017 © Pedro Peláez
 

library encryption

A small PHP class for create, encrypting or decrypting your passwords.

image

jnativel/encryption

A small PHP class for create, encrypting or decrypting your passwords.

  • Friday, October 13, 2017
  • by jnativel
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Encryption

A small PHP class for create, encrypting or decrypting your passwords, (*1)

Installation using Composer

$ composer require jnativel/Encryption

Usage

You can use the "generateKey()" method for generate a safe password. You can set the lenght and diffrents type of characters (upper, number, symbol), (*2)

<?php
require 'vendor/autoload.php';
$encryption = new jnativel\Encryption\Encryption();
$password = $encryption->generateKey(16, true, true, true);
var_dump($password);

You must define a master key for encrypt and decrypt your password or your character string. Example of use by passing the master key directly by the methods:, (*3)

<?php
require 'vendor/autoload.php';
$masterKey = "my-secret-key";
$encryption = new jnativel\Encryption\Encryption();
$password = $encryption->generateKey();
$str_encrypt = $encryption->encrypt($password, $masterKey);
$str_decrypt = $encryption->decrypt($str_encrypt, $masterKey);
var_dump($encryption->getMasterKey());
var_dump($str_encrypt);
var_dump($str_decrypt);

If you wish, you can also by passing the master key by the constructor, (*4)

<?php
require 'vendor/autoload.php';
$masterKey = "my-secret-key";
$secret = "my-secret-string";
$encryption = new jnativel\Encryption\Encryption($masterKey);
$str_encrypt = $encryption->encrypt($secret);
$str_decrypt = $encryption->decrypt($str_encrypt);
var_dump($encryption->getMasterKey());
var_dump($str_encrypt);
var_dump($str_decrypt);

The Versions

13/10 2017

dev-master

9999999-dev https://github.com/jnativel

A small PHP class for create, encrypting or decrypting your passwords.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

by Jimmy NATIVEL

password encryption jnativel

13/10 2017

v1.0

1.0.0.0 https://github.com/jnativel

A small PHP class for create, encrypting or decrypting your passwords.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

by Jimmy NATIVEL

password encryption jnativel