Download the PHP package maymeow/cryptography without Composer

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

MayMeow/Cryptography

Cryptographic library for encrypting and decrypting data the symetrical and asymetrical way.

This package replaces https://github.com/MayMeow/php-encrypt

PHP Composer

Requirements

What it is contained

Development

This project contains dev container. To start development build container

This container running as user vscode with uid 1000. Start container

or it can be used as configuration for remote PHP processor in PHPStorm.

Usage

Symmetrical encryption

Using one key for encrypt and decrypt data. This library has default method set to aes-256-gcm

Encrypt text as follows

And then you can decrypt text as example shows bellow

Keep your key safe because you need it to decrypt data. You don't need to remember IV (initialization vector) because it is generated for each encryption, and then it is part of encrypted data.

Asymmetrical encryption

Asymmetrical encryption using two different keys. One for encryption and one for decryption. They are mostly known as private and public keys. The public one is that you want to share to someone. With public key you can encrypt data (or someone who want to send you message) and with private key you can decrypt and read data. Private key can be protected by password. Here is example

Exporting and importing keys

To use keys for later in case of encrypt/decrypt data is important to store them on some place. For this I created Readers and Writers. To export keys use Writer as example shows bellow:

If you want implement own Writers they must implement MayMeow\Cryptography\Tools\RsaParametersWriterInterface.

Importing keys can be done as on example below:

Like on writers you can implement your own Readers too. If you do so your new reader have to implement MayMeow\Cryptography\Tools\RsaParametersReaderInterface

Locators

Both reader and writer in above example is using Locator. Locators are classes which can return string representation of location where are stored RSAParameters parts. This can be database table, model, table field, path in filesystem and more. Interfaces for Reader and Writer not required to use one, but I recommend it.

If you want implement your own locator, this has to implement MayMeow\Cryptography\Tools\RSAParametersLocatorInterface.

As example, you can check Tools in test folder.

Cryptographic key derivation

Contribute

Feel free to contribute to this project. For contribution guide please check https://github.com/MayMeow/contribution

License MIT


All versions of cryptography with dependencies

PHP Build Version
Package Version
Requires php Version 8.0.*
ext-openssl Version *
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 maymeow/cryptography contains the following files

Loading the files please wait ....