Download the PHP package moviet/php-encryption without Composer
On this page you can find all versions of the php package moviet/php-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moviet/php-encryption
More information about moviet/php-encryption
Files in moviet/php-encryption
Package php-encryption
Short Description A speed metal encryption library for php
License MIT
Homepage https://github.com/moviet/php-encryption
Informations about the package php-encryption
Crypsic - A speed metal encryption library for php
Crypsic is made to be Fast and Secure By Default
This is pretty suits for PHP devlovers and also built up for standalone like pro,
our sources does very simply, included Crypsic and Pwsuit for supporting native Ops
Requirements
- PHP v5.6 (non-tested) or PHP v7.0+ (tested)
- Openssl extensions must be enable
- Composer autoload PSR4
- Composer for installation
Let's Start
Installation
Best Practices
- Do not ever encrypt a password
- Use our instant
Pwsuit
to protect a password that supply modern hashes - Pwsuit dedicated for non-coverable performed, so do not forget the password
- Do not use
a same key
for many secret informations, you can do it well - You may need a concern to manage the keys correctly, it must be treat a safely
Encryption
doesn't same as s-e-c-u-r-i-t-y, so do not construct a bullet proof- You must follow the standard security design that suitable for your system
Features
- A Symmetric Crypto
- Customable Cipher Modes
- Instant Encrypt And Decrypt
- Auto Generate Secure Random Key
- Suitable Password Algorithms
- Secure A Key With Password
A Symmetric Crypto
It's meant the current crypto available is only for crafting symmetric encryption
Customable Cipher Modes
-
You can modify the cipher modes using our own mode functions like
this is optional usage, if nothing, it will set to as default mode
notes :
If you want to set mode, please use one for one operation, if you don't know we're highly recommended that you ignore it, and set as default mode for easy usage.
Instant Encrypt And Decrypt
-
You can encrypt a secret ID, texts or any others secret information like
- And simply decrypt your secret information like
Auto Generate Secure Random Key
-
You can not decrypt your secret information without a key, so you must create a key at first
Notes : don't forget to generate a long and heavy characters for your key
it will auto calculate your key with Cryptographically Secure Random functions
for PHP v7.0+ and Openssl pseudo random for PHP v5.6 by very happier
- After you save a key belong encryption data, so you can confirm like so
Suitable Password Algorithms
-
You can dynamically set a Password like so
-
or custom like
on above will equivalent like
password_hash('My password', PASSWORD_DEFAULT, ['cost'=>26])
-
If you use new PHP v7.2+ you can try Modern Hashes like
-
or any custom like
it will give you a nicely smile by PHP 'out of the box'
Secure A Key With Password
-
We attach new crazybility to protect your secret with password like below
Notes :
a 'cost' length is optional, if higher may have slow, but that was better
-
Then to decrypt and verify your secret using key with password just simply
Notes :
Hash and encrypt data has different results, please use correctly
-
You can also use this lib as standalone to generate password and to verify
-
Refresh the old password hashed using like
- Ensuring the current hashed data that you've decorated
Happy Usage
Encrypt And Decrypt With No Password :
Encrypt And Decrypt With Password :
You may want to arrangement the key from sabotage, please follow this rockly :metal:
Cipher Modes :
Attributes | Modes |
---|---|
CBC-256 | AES-256-CBC |
CBC-192 | AES-192-CBC |
CBC-128 | AES-128-CBC |
CTR-256 | AES-256-CTR |
CTR-192 | AES-192-CTR |
CTR-128 | AES-128-CTR |
Hash Algorithms :
Default | Value |
---|---|
cost | 14 |
memory_cost | 1666 |
time_cost | 6 |
threads | 6 |
Attributes | Modes |
---|---|
Default | PASSWORD_DEFAULT |
Argon2i | PASSWORD_ARGON2I |
Argon2d | PASSWORD_ARGON2D |
Argon2id | PASSWORD_ARGON2ID |
Conclusion
By descriptions on above, you may have a short picture of how easy to use this lib
How secure is this ?
- you do not worry about it, even on production, it can do it well
- if you use for commercial projects please follow the best practises
License
Moviet/php-encryption
is released under the MIT public license. See the enclosed LICENSE for details.
All versions of php-encryption with dependencies
ext-mbstring Version *
ext-openssl Version *