Coder Social home page Coder Social logo

求教sm9加密之后使用asn1_sequence_of_from_der去除了前9或10字节头之后,还是比纯粹的的密文多4字节 about gmssl HOT 3 CLOSED

hanlinbao avatar hanlinbao commented on July 20, 2024
求教sm9加密之后使用asn1_sequence_of_from_der去除了前9或10字节头之后,还是比纯粹的的密文多4字节

from gmssl.

Comments (3)

hanlinbao avatar hanlinbao commented on July 20, 2024 1

发现了里面的c3和c2部分还有asn头,c3部分是0420,c2部分是04xx。
又有新问题了,现在加密结果和全大端序格式的芯片不能互相加解密,只能各自解各自的,而这个芯片可以和其它厂商芯片互通。尝试对硬件密文4字节和8字节还有整个c123端序翻转,还是无法软仿解密它

from gmssl.

emmansun avatar emmansun commented on July 20, 2024 1

BER/DER不都是TLV结构吗?你要解析ASN1密文应该调用本库的sm9_ciphertext_from_der方法吧。

from gmssl.

hanlinbao avatar hanlinbao commented on July 20, 2024

BER/DER不都是TLV结构吗?你要解析ASN1密文应该调用本库的sm9_ciphertext_from_der方法吧。

十分感谢,才发现我应该用sm9_do_encrypt就没有asn头了

from gmssl.

Related Issues (20)

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.