Comments (8)
我请教了下“梧桐链”的开发者,他们给了点方向、建议,如下:
- 初步的判断是跟签名时使用的随机数有关
- 机数过大使得签名或验签过程中求值溢出了
- 多注意下签名与验签流程中的求值取余mod操作,以及大数的正负情况
from gm.
请问你的公私钥是怎么生成的?
我写了点循环测试代码,没有测出来这个问题。
随机数k过大的问题应该不存在,按照算法k是要1=<k<=n-1的,代码中也是这么实现的。
from gm.
本身的循环测试,是没发现问题的(我测试了100万次,跑了24小时)
但是,在现实业务场景中,偶尔会发送验签失败的情况
from gm.
那就不好排查了,要不你们可以试一下签名刚产生时就验签一下。主要是想看看有没有可能是数据或签名在传输流转过程中被改变了。
from gm.
这个问题你们有线索了吗?
from gm.
不好意思,最近没搞这个事情(其实是放弃了。。。)
没有特别的线索
from gm.
@ZZMarquis 我最近用同济的国密库,也发现类似的问题。
情况是这样的:
1) 每次都创建ca 证书,以及使用ca证书签发子证书
2)子证书验签失败
这个过程是偶尔发生的。
有什么想法吗?
from gm.
大佬们, 有新发现.
r, s, err := sm2.SignToRS(pri, nil, msg)
if err != nil {
return "", err
}
hexSign := fmt.Sprintf("%x", r) + fmt.Sprintf("%x", s)
sm3摘要做了略微调整, 没有加盐, 直接使用原文摘要的.
发现结果偶尔是127位的(大部分时候是128位). 大佬请看一下.
from gm.
Related Issues (17)
- 函数notEncrypted中的bug HOT 1
- x509转成publice key HOT 1
- sm2 Decrypt HOT 1
- 问题 关于公钥的 X, Y 如何生成 pem文件的字符串 HOT 3
- sm2签名在gmssl服务端验证失败 HOT 2
- 建议 HOT 1
- 针对sm2.Verify的cpu性能问题,有提升方案吗 HOT 3
- 能否加一个zeroPadding,不知道咋写 HOT 3
- Public key raw bytes length must be 64 HOT 7
- 仿造招行Java的Sm2SignWithSm3,实现的签名方法报错,请教大佬 HOT 7
- 为什么会出现 data[0] != 4 这个问题 HOT 1
- sign/verify结果输出问题 HOT 1
- Java端SM2加密,golang无法解密,golang端SM2加密,java无法解密 HOT 1
- sigtopub HOT 6
- SM4加密结果JAVA无法解密 HOT 5
- sm2进行加解密时,建议对公钥的X和Y的[]byte类型进行填充 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gm.