Skip to content

A simple class to encrypt and decrypt strings with a given salt (bijective).

License

Notifications You must be signed in to change notification settings

dandjo/simple-obfuscator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Obfuscator

A simple class to encrypt and decrypt strings with a given salt (bijective).

Installation

composer require dandjo/simple-obfuscator

Usage

Instantiate the Obfuscator.

// create a new instance
$salt = 'my-security-by-obscurity';
$obfuscator = new \Dandjo\SimpleObfuscator\SimpleObfuscator($salt);

Then you can encrypt your string and decrypt the generated hex string.

$encrypted = $obfuscator->encrypt('4711-foobar');  // $encrypted == "6f927ea5a49b7c"
$decrypted = $obfuscator->decrypt('6f927ea5a49b7c');  // $decrypted === "4711-foobar"

About

A simple class to encrypt and decrypt strings with a given salt (bijective).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages