kkiernan/caesar-cipher 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kkiernan/caesar-cipher

最新稳定版本:v1.3

Composer 安装命令:

composer require kkiernan/caesar-cipher

包简介

Encrypt, decrypt and crack messages using the simple Caesar Cipher algorithm.

README 文档

README

A basic Caesar Cipher class in PHP for fun and learning.

Build Status Style Status

Installation

Install the package using Composer.

composer require kkiernan/caesar-cipher

Instantiation

Create a new CaesarCipher instance. Make sure to import the class or use the fully qualified class name.

$cipher = new KKiernan\CaesarCipher();

Available Methods

Encrypt

To encrypt a message, pass the CaesarCipher instance some plaintext and a key. In a Caesar Cipher, the key is just the number of places to shift each letter in the plaintext.

$ciphertext = $cipher->encrypt('This is a plain text message that will be encrypted!', 8);

Decrypt

To decrypt a ciphertext, use the decrypt method on the CaesarCipher instance. Pass in the ciphertext and the key that was used to encrypt the message.

$plaintext = $cipher->decrypt($ciphertext, 8);

Crack

You can attempt to crack an encrypted message by using the crack method, which will return a best guess for the key's value. Use the key to retrieve the plaintext.

$key = $cipher->crack('Max wtrl tkx zxmmbgz lahkm tztbg.');

$plaintext = $this->decrypt($ciphertext, $key);

Security

This was written for fun and learning very basic encryption techniques (like substitution in this case). Obviously Caesar Cipher is not a secure encryption algorithm (only 25 possible keys), so don't use this for anything sensitive. It's really a toy meant for fun.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固