• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yigefanqie
V2EX  ›  程序员

各位 V 友大佬们下午好,请教个算法的小白问题,关于 SM2 算法。

  •  
  •   yigefanqie · Sep 30, 2024 · 2889 views
    This topic created in 773 days ago, the information mentioned may be changed or developed.

    各位大佬们好,javascript 有很多 sm2 算法的开源库,这些库对相同数据加密 doSignature 的底层算法都一样,还是会有差异呢。

    5 replies  •  2024-10-01 14:46:23 +08:00
    Maerd
    Maerd
    Sep 30, 2024
    1
    功能上一致就行了,不需要考虑那么多
    gongxuanzhang
    gongxuanzhang
    Sep 30, 2024
    2
    国标和国际 SM2 的参数有点区别
    iyiluo
    iyiluo
    Sep 30, 2024
    3
    国密改造的吧? sm2 对接有两个坑,一个是 sm2 有 c1c2c3 模式和 c1c3c2 模式,还有一个是加密后的字符串需不需要去除 04 前缀
    yigefanqie
    yigefanqie
    OP
    Oct 1, 2024
    4
    @iyiluo 谢谢🙏大佬
    huiyuanai709
    huiyuanai709
    Oct 1, 2024 via iPhone
    5
    @yigefanqie 签名最后有两个 BigInteger r 和 s 这两个 有很多种编码规则 比如转成 byte 数组 32 位对齐,也有使用默认的 standarddsa 具体看双方要求 https://mp.weixin.qq.com/s/6kXOb92I-ZqpwR1mLaI3AQ
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2047 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:22 · PVG 23:22 · LAX 07:22 · JFK 10:22
    ♥ Do have faith in what you're doing.