定制 andrewcarteruk/cryptokey 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andrewcarteruk/cryptokey

最新稳定版本:v0.2.0

Composer 安装命令:

composer require andrewcarteruk/cryptokey

包简介

A command line tool for generating keys using a CSPRNG.

README 文档

README

Latest Stable Version Build Status Code Coverage Scrutinizer Code Quality Total Downloads License

A tool for generating keys using a CSPRNG.

If you have OpenSSL installed read below, as you probably do not need to install this tool.

By AndrewCarterUK (Twitter)

How To Install

composer global require andrewcarteruk/cryptokey

Make sure you have added your global composer binary directory to the PATH in your ~/.bash_profile (or ~/.bashrc) file:

export PATH=~/.composer/vendor/bin:$PATH

This blog explains the process of global composer installs in more detail.

Usage

$ cryptokey generate
bGS6lzFqvvSQ8ALbOxatm7/Vk7mLQyzqaS34Q4oR1ew=

$ cryptokey generate --format=hex
531a5187f08846a40ab6a9f9c651831bdd188e84b026804039773ef0aa51e500

$ cryptokey generate --entropy=64
ladkecOLF7RvMl/J5EGr/SMz5InfSyX+DA9CvecE/OiVFndnMqgvfLofNGO6/Gc5P1Io+eHYhcJphIRHCB9Kpg==

You can use the --format option to switch between base64 (default) and hex output.

You can use the --entropy option to select the number of bytes of entropy. The default is 32 bytes (256 bits).

An Alternative: OpenSSL

If you have OpenSSL installed, you may find that the command(s) below are sufficient for your needs:

$ openssl rand -base64 32
3cDyOf7I6P4sU+ImVmIJW8k/IzGyoCACaJi+PbVY+I8=

$ openssl rand -hex 32
78a59462d4264e29be184226e7a46de0df96f97682963977fe61970b632d9faa

The OpenSSL command has -base64 and -hex options for switching between base64 and hex output.

The final argument is the number of bytes of entropy to draw. The number of bits of entropy is this number multiplied by 8.

统计信息

  • 总下载量: 23.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 61
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 61
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-14