Download the PHP package wpfly/crypto without Composer

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

crypt

介绍

常用加密/解密库,目前包括RSA加密/解密、整数加密/解密、AES加密/解密。

安装方法

$ composer require wpfly/crypto

使用说明

use wpfly\Crypto;


//RSA加密、解密

//自带公钥私钥,以便“开箱即用”去试验。实际中使用,请【一定】【一定】【一定】重新设置密钥后再加密(参考sample/index.php中用例6)!

$crypto = new Crypto();

$s = '我真是个天才!';

$d1 = $crypto->privEncrypt($s);

$d2 = $crypto->pubDecrypt($d1);

$d3 = $crypto->pubEncrypt($s);

$d4 = $crypto->privDecrypt($d3);

var_dump($s, $d1, $d2, $d3, $d4);


//数字加密、解密

$crypto = new Crypto();

$num = '12';

$key = 644;

$r1 = $crypto->numberEncrypt($num, $key, 10);

$r2 = $crypto->numberDecrypt($r1, $key);

var_dump($num, $r1, $r2);


//输出结果:

//string(2) "12"

//string(10) "0707549034"

//string(10) "0000000012"


//AES加密、解密

$crypto = new Crypto();

$s = '我真是个天才!';

$d1 = $crypto->aesEncrypt($s, 'password5');

$d2 = $crypto->aesDecrypt($d1, 'password5');

var_dump($s, $d1, $d2);


更多使用示例参看 sample/index.php

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

All versions of crypto with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 wpfly/crypto contains the following files

Loading the files please wait ....