dongyunlee / sm3-php Goto Github PK
View Code? Open in Web Editor NEW国密标准SM3的PHP实现
Home Page: http://sm3.doylee.cn
License: Mozilla Public License 2.0
国密标准SM3的PHP实现
Home Page: http://sm3.doylee.cn
License: Mozilla Public License 2.0
SM3-PHP/examples/sm3_file/sm3_file.php
Line 18 in fad1211
我这边是 2daef60e7a0b8f5e024c81cd2ab3109f2b4f155cf83adeb2ae5532f74a157fdf
本地 远程都是 echo sm3_file('https://raw.githubusercontent.com/DongyunLee/SM3-PHP/master/examples/sm3_file/test.txt');
测试服务器信息 **************
请描述下你需要的功能相关的问题
现在的计算方式太慢了,需要把把二进制转化成可读的十进制数字(1、0)然后再算
请描述下你预期的解决方案
PHP直接操作二进制
额外信息
整个项目全部重构,精简代码
问题
仓库非 commitizen-friendly,需要进一步调研是否需要适配,以及适配后是否能提高效率。
预期的解决方案
《making-your-repo-commitizen-friendly》
大佬把 sm2 sm3 sm4 都加上吧
Originally posted by @lizhichao in #18 (comment)
bug描述
例如:sm3(hexToStr("31313131323232329988"));
这样计算出来的结果是:49f5ee514b753fe9c8a0a8385301ff91e53847800e613520bfcbec787845e373
而标准结果是:f639edc383b5031b24e3c2f0c3414970ae3d0537716627c8d1c486676da0b8c0
太遗憾了
这个代码是怎么指定密钥来进行加密的呢
请描述下你需要的功能相关的问题
生成文件的 sm3 标识
请描述下你预期的解决方案
请描述下你考虑过的替代方案
替代?不存在的,莽就完了
require 'vendor/autoload.php';
use SM3\SM3;
$sm3 = new SM3('abc');
echo $sm3;
这边报错引用不到require 'vendor/autoload.php';
请问一下,这个是引用Composer 的吗
环境:
debian 7.8
PHP 5.4.45-0+deb7u11 (cli) (built: Aug 30 2017 01:07:33)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
下载release V1.1.2, V1.1.1 访问demo.php
计算结果均为: 183920f00e15a0433ee3a8fc90dd9ac164c4142ccf63ca189a8f645ec96ff8de
正确结果为: 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0
下载部署V1.1 , 复制V1.1.2的demo.php 访问可以得到预期结果. 是否高版本引入了问题?
当前应该是会做一个去除空格的替换,但是把BitString里的空格替换去掉还是不行
问题描述
当输入包含whitespace时,得到的结果和openssl(1.1.1d 10 Sep 2019)不同
复现
执行如下代码:
<?php
/**
* demo @ sm3-php
*
* Code BY ch4o5
* 10月. 12th 2019
* Powered by PhpStorm
*/
require 'vendor/autoload.php';
$sm3 = sm3("a a");
echo $sm3;
结果:
1076807302544460b26944d7756a067bd4e135e2076889e86d62db5b5a10c867
对比openssl
执行:
openssl dgst -sm3 test.txt
结果:
SM3(test.txt)= d6ef141c5faa9bbde67cbc9f45988d6158eaf0bc2ab492bb489a6524ca492cbc
对比在线工具
另一个在线工具的例子(http://aks.jd.com/tools/sec/):
环境 :
Describe the bug
在同一个文件中多次调用,第二次调用报错:
Constant BIN_TO_HEX_NUM already defined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.