Code Monkey home page Code Monkey logo

Comments (13)

human-user avatar human-user commented on June 16, 2024 1

后端用的国密工具是gmhelper,还是自己封装的bouncycastle?如果是前者,那么可能是cipherMode没有选对,或者密文不是以0x04字节开头

from sm-crypto.

fanthos avatar fanthos commented on June 16, 2024 1

根据标准,密文前面需要加上0x04

from sm-crypto.

756616071 avatar 756616071 commented on June 16, 2024

大佬好, 请教一个问题 ,
我使用的是c#后端
同秘钥情况下,前后都能加解密,但是就是不能交叉加解密
这是为啥呢,有什么解决办法吗

from sm-crypto.

fanthos avatar fanthos commented on June 16, 2024

@756616071 看看密文第一个字节是不是0x04

from sm-crypto.

756616071 avatar 756616071 commented on June 16, 2024

在后端看是不是 0x40吗

from sm-crypto.

fanthos avatar fanthos commented on June 16, 2024

不兼容有几个常见问题,比如第一个字节有0x04,C1C2C3/C1C3C2,需要查文档

from sm-crypto.

756616071 avatar 756616071 commented on June 16, 2024

image

from sm-crypto.

756616071 avatar 756616071 commented on June 16, 2024

没有 0x40

from sm-crypto.

756616071 avatar 756616071 commented on June 16, 2024

后端使用的是c1c2c3

from sm-crypto.

fanthos avatar fanthos commented on June 16, 2024

@756616071 看源码,两边的标准必须一样

from sm-crypto.

756616071 avatar 756616071 commented on June 16, 2024

标准指的是字符串标准吗

from sm-crypto.

lwmxiaobei avatar lwmxiaobei commented on June 16, 2024

请问这个问题解决了吗?我也遇到了,nodejs 加密解密正常,java 那边解密失败;java 给的密钥是 16位的,我转成 32位的 hex 进行加密,但是 java 解密不了

from sm-crypto.

herbertxy avatar herbertxy commented on June 16, 2024

给后来的兄弟提醒下,一般后端是以04开头密文来解密的, 该库没有属于去除04的,解密是库的函数自动加上的, 其他的后端库如go,属于密文必须04开头的,所以需要在传给后端密文时候手动加上04

from sm-crypto.

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.