Download the PHP package krak/crypto without Composer

On this page you can find all versions of the php package krak/crypto. 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 crypto

Crypto

A well designed cryptographic library for php.

Install

Design

The Crypto Library has two main interfaces: Crypt and Pad.

A Crypt is what does the encryption and decryption.

A Pad is what does the padding and stripping.

Usage

All Crypts implement the interface Krak\Crypto\Crypt

You can also use any of the Krak\Crypto\Pad classes

Crypt

The Crypt libraries are responsible for encrypting the data. There are crypt implementations that do encryption and others that are just decorators.

McryptCrypt and OpenSSLCrypt handle encryption. Each crypt uses the Krak\Crypto\pack_payload method to prepend the iv to the cipher text.

Note: Please be knowledgeable of the keys you pass in. The key size depends on the algorithm and typically ranges from 8, 16, 24, or 32 bytes.

Base64Crypt, HmacCrypt, and are decorators for providing base64 encoding and hmac signing/authentication for your messages.

GnuPGCliCrypt handles encrypting via the gpg cli utility.

It will encrypt/decrypt data with the public and private keys for the given $username. Important: you need to make sure the keys are properly imported into your gpg cli tool. We use the --always-trust flag for encrypting, so make sure the keys you add are properly trusted.

This crypt also requires the symfony/process component to be installed.

NullCrypt is used more for testing or mocking. It just returns the data passed to it.

Pad Types

Iv Gen

The crypts take in a parameter for iv generation. There are three types:

Streams

The crypt library has also created a concept called a Stream. Crypto streams works very similar to nodejs streams, where they are stream of buffers/content. Streams are very handy for encrypting large amounts of data because of how they efficiently pipe their information along. Here's an example of using streams to upper case content, encrypt, and then encode.

Look at the API to see all of the different streams and how to use them.

API

Run make api to create the api documentation. Then open up docs/api/index.html to view the API docs.

Test

Run tests with peridot via


All versions of crypto with dependencies

PHP Build Version
Package Version
Requires nikic/iter Version ^1.3
paragonie/random_compat Version ^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 krak/crypto contains the following files

Loading the files please wait ....