- 授权协议: GPLv3
- 开发语言: PHP
- 操作系统: 跨平台
- 软件首页: https://paragonie.com/project/halite
- 软件文档: https://github.com/paragonie/halite/blob/master/README.md
- 官方下载: https://github.com/paragonie/halite/archive/master.zip
软件介绍
Halite 是PHP项目中一个简单的libsodium封装包。Halite提供高级的加密接口,依靠其所有潜在的密码操作libsodium。
Halite 基本 API:
Encryption
Anonymous
Authenticated
Asymmetric\Crypto::seal(HiddenString,EncryptionPublicKey):stringAsymmetric\Crypto::unseal(string,EncryptionSecretKey):HiddenStringAsymmetric\Crypto::encrypt(HiddenString,EncryptionSecretKey,EncryptionPublicKey):stringAsymmetric\Crypto::decrypt(string,EncryptionSecretKey,EncryptionPublicKey):HiddenStringSymmetric\Crypto::encrypt(HiddenString,EncryptionKey):stringSymmetric\Crypto::decrypt(string,EncryptionKey):HiddenStringSymmetric
Asymmetric
Authentication
Asymmetric\Crypto::sign(string,SignatureSecretKey):stringAsymmetric\Crypto::verify(string,SignaturePublicKey,string):boolSymmetric\Crypto::authenticate(string,AuthenticationKey):stringSymmetric\Crypto::verify(string,AuthenticationKey,string):boolSymmetric
Asymmetric
示例1:加密解密消息
首先,生成一个key
<?php use ParagonIE\Halite\KeyFactory; $encKey = KeyFactory::generateEncryptionKey(); KeyFactory::save($encKey, '/path/outside/webroot/encryption.key');
然后,加密解密消息
<?php
use ParagonIE\Halite\HiddenString;
use ParagonIE\Halite\KeyFactory;
use ParagonIE\Halite\Symmetric\Crypto as Symmetric;
$encryptionKey = KeyFactory::loadEncryptionKey('/path/outside/webroot/encryption.key');
$message = new HiddenString('This is a confidential message for your eyes only.');
$ciphertext = Symmetric::encrypt($message, $encryptionKey);
$decrypted = Symmetric::decrypt($ciphertext, $encryptionKey);
var_dump($decrypted === $message); // bool(true)示例2:用password-derived key 加密消息
<?php
use ParagonIE\Halite\HiddenString;
use ParagonIE\Halite\KeyFactory;
use ParagonIE\Halite\Symmetric\Crypto as Symmetric;
$passwd = new HiddenString('correct horse battery staple');
// Use random_bytes(16); to generate the salt:
$salt = "\xdd\x7b\x1e\x38\x75\x9f\x72\x86\x0a\xe9\xc8\x58\xf6\x16\x0d\x3b";
$encryptionKey = KeyFactory::deriveEncryptionKey($passwd, $salt);
$message = new HiddenString('This is a confidential message for your eyes only.');
$ciphertext = Symmetric::encrypt($message, $encryptionKey);
echo $ciphertext, "\n";
人工智能的未来
Jeff Hawkins、Sandra Blakeslee / 贺俊杰、李若子、杨倩 / 陕西科学技术出版社 / 2006.1 / 18.5
陕西科技出版社最新引进美国图书《人工智能的未来》(On Intelligence)一书,是由杰夫•霍金斯,一位在硅谷极其成功、受人尊敬的计算机工程师、企业家与桑德拉•布拉克斯莉,《纽约日报》的栏目作家共同撰写。本书对人类大脑皮层所具有的知觉、认识、行为和智能功能新理论提出了新的理论构想。这一理论的独到之处在于对大脑皮层的现行认识提出了新的观点,对大脑的工作原理,即霍金斯称之为“真正智能”而非计算机......一起来看看 《人工智能的未来》 这本书的介绍吧!
在线进制转换器
各进制数互转换器
Base64 编码/解码
Base64 编码/解码
