nihilsen/keypad 问题修复 & 功能扩展

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

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

nihilsen/keypad

最新稳定版本:v0.4.0

Composer 安装命令:

composer require nihilsen/keypad

包简介

Client-side cryptography framework for Laravel using Blade components and native Web Crypto API.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Keypad is a Laravel package that aims to make it easier to add client-side encryption and decryption to your Laravel applications.

Keypad offers a suite of reactive Blade components that can be inserted into your existing authentication forms.

Under the hood, Keypad uses browser-native Web Crypto API.

Installation

You can install the package via composer:

composer require nihilsen/keypad

You can run the migrations with:

php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="keypad-config"

This is the contents of the published config file:

https://github.com/nihilsen/keypad/blob/14e862c555354edbf36fa851c09a167114930a98/config/keypad.php#L3-L23

Components and usage

Login: <x-keypad::login>

<form method="POST" action="/login/">
    {{ -- CSRF token -- }}
    @csrf
    
    {{ -- email field -- }}
    <input type="email" name="email_field" placeholder="email" />
    
    {{ -- password field -- }}
    <input type="password" name="password_field" placeholder="password" />
    
    {{ -- Keypad "login" component -- }}
    <x-keypad::login password="password_field" />
    
    {{ -- other form elements, submit button, etc ... -- }}
</form>

Register: <x-keypad::register>

<form method="POST" action="/register/">
    {{ -- CSRF token -- }}
    @csrf
    
    {{ -- email field -- }}
    <input type="email" name="email_field" placeholder="email" />
    
    {{ -- password field -- }}
    <input type="password" name="password_field" placeholder="password" />
    
    {{ -- confirm password field -- }}
    <input type="password" name="confirm_password_field" placeholder="confirm password" />
    
    {{ -- Keypad "register" component -- }}
    <x-keypad::register password="password_field" confirmation="confirm_password_field" />
    
    {{ -- other form elements, submit button, etc ... -- }}
</form>

Encrypt: <x-keypad::encrypt>

<form method="POST" action="/send_message/">
    {{ -- CSRF token -- }}
    @csrf
    
    {{ -- plaintext message field -- }}
    <input type="text" name="secret_message" placeholder="Enter your message" />
    
    {{ -- get recipient keypad -- }}
    @php
        $recipient = User::find($__GET['recipient_id']);
        $keypad = $recipient->keypad;
    @endphp
    
    {{ -- Keypad "encrypt" component -- }}
    <x-keypad::encrypt target="secret_message" :$keypad />
    
    {{ -- other form elements, submit button, etc ... -- }}
</form>

Decrypt: <x-keypad::decrypt>

<x-keypad::decrypt>{{ $message->secret_message }}</x-keypad::decrypt>

Changelog

Please see CHANGELOG for more information on what has changed recently.

Roadmap

  • <x-keypad::login />
  • <x-keypad::register />
  • <x-keypad::encrypt />
  • <x-keypad::decrypt />
  • <x-keypad::hash />
  • <x-keypad::change-password />
  • <x-keypad::recover />

Contributing

  • Pull requests, bug reports and feature requests are welcome.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固