Download the PHP package koltsov/justencrypt without Composer

On this page you can find all versions of the php package koltsov/justencrypt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package justencrypt

JustEncrypt PHP library

===========================

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version

PHP Support

This library supports PHP versions 5.6 through 7.1. Using PHP 7.1 is highly recommended, because the OpenSSL extension now supports the algorithm we use. Otherwise, you fall back on a much slower implementation in native PHP.

Usage

Key Derivation

The following example shows simple key derivation from a password/salt/iterations Simple derivation example

KeyDerivation::generateSalt() will return a salt using the current default. Encryption::encrypt will generate the salt/iterations above using library defaults

Encryption

An encrypted blob is the concatenation of saltLen (uint8) || salt || iv || ct || tag The serialized parameters allow us to decrypt on any machine knowing only the password.

Simple encryption example Advanced example with subkeys & root key recovery

Encryption::encrypt returns an EncryptedBlob, which encapsulates key derivation data and ciphertext details. It also exposes useful methods for the ciphertext:

Encryption Mnemonic

To make the result of encrypt human readable (so it is easier to write down) it's possible to encode it as an mnemonic. We're using the Bitcoin BIP39 way of encoding entropy to mnemonic, but ignoring the (weak) password protection BIP39 originally had. We also ensure the data is padded correctly.

$encrypted->getMnemonic() calls the EncryptedMnemonic class to produce Encryption Mnemonic example

Choosing iterations

The default iterations is justencrypt.KeyDerivation.defaultIterations and is set to 35000, this is a number that should remain secure enough for a while when using a password.
If you don't pass in the iterations argument it will default to this.

If you're encrypting with a CSPRNG generated random byte string as the password then you can use the same code, except in that case setting the iterations to 1 is secure as there's no need to stretch the password.
You can use justencrypt.KeyDerivation.subkeyIterations in that case to make it clear what your intentions are.

This type of usage is demonstrated in this example

Development / Contributing

Please see CONTRIBUTING.md for details on contributing.

License

JustEncrypt is released under the terms of the MIT license. See LICENCE.md for more information or see http://opensource.org/licenses/MIT.


All versions of justencrypt with dependencies

PHP Build Version
Package Version
Requires bitwasp/buffertools Version ^0.5.0
paragonie/random_compat Version ^1.0|^2.0
spomky-labs/php-aes-gcm Version *
paragonie/constant_time_encoding Version ^1.0|^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package koltsov/justencrypt contains the following files

Loading the files please wait ....