Coder Social home page Coder Social logo

结果验证 about cryptogm HOT 6 CLOSED

xlcetc avatar xlcetc commented on June 12, 2024
结果验证

from cryptogm.

Comments (6)

triplewz avatar triplewz commented on June 12, 2024

可以参考GM-Standards里面文档给的例子,进行自测和验证,如果是商用软件的话可以请测评机构进行商密测评。

  • sm3、sm4算法、参数比较固定,比较容易验证,按标准文档的例子测试即可,不过这个算法库提供了对称加密的ecb和cbc模式,方便开发使用,这个目前国密标准也没有强制要求;
  • sm2算法其实里面有一些参数也不确定,比如uid,目前是用的标准文档中的例子“1234567812345678”,但是标准中也没有强制要求一定要用这个,所以想要验证的话没有非常确定的数据,目前是和大部分国密算法库采用相同的实现方式,基本也能通过国密的测评;
  • sm9算法主要是双线性配对实现的方式,其实标准文档里也没有强制要求的,算法库实现方式和标准文档的方式略有不同,但如果想要显示相同结果,需要做一些转化即可。

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

可以参考GM-Standards里面文档给的例子,进行自测和验证,如果是商用软件的话可以请测评机构进行商密测评。

  • sm3、sm4算法、参数比较固定,比较容易验证,按标准文档的例子测试即可,不过这个算法库提供了对称加密的ecb和cbc模式,方便开发使用,这个目前国密标准也没有强制要求;
  • sm2算法其实里面有一些参数也不确定,比如uid,目前是用的标准文档中的例子“1234567812345678”,但是标准中也没有强制要求一定要用这个,所以想要验证的话没有非常确定的数据,目前是和大部分国密算法库采用相同的实现方式,基本也能通过国密的测评;
  • sm9算法主要是双线性配对实现的方式,其实标准文档里也没有强制要求的,算法库实现方式和标准文档的方式略有不同,但如果想要显示相同结果,需要做一些转化即可。

请问sm9 的签名结果与官方文档测试的最终结果不一致要怎么转为一致呢?

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

不一致指什么不一致?结果不一样还是格式不一样呢?

from cryptogm.

YLINR avatar YLINR commented on June 12, 2024

不一致指什么不一致?结果不一样还是格式不一样呢?

结果不一致
image
实现的签名算法输出结果与上图不一致

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

由于bn曲线扩域方式不一样, 结果确实会不一样。

from cryptogm.

triplewz avatar triplewz commented on June 12, 2024

对于国密算法,可以参考另外开源项目gmsm

from cryptogm.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.