Skip to content
This repository was archived by the owner on Jun 25, 2026. It is now read-only.
This repository was archived by the owner on Jun 25, 2026. It is now read-only.

miniprogram-sm-crypto 后端使用sm4加密,前端无法解密 #41

Description

@peteryang2016

key=1111111111111111
iv=1111111111111111
加密内容原文:123 加密后结果:Yv5pzHfZHZLaWRFv/EcKvQ==
后端和在线sm4解密工具都可以。

前端在小程序中就无法解密,打印到控制台为空;
小程序传iv和key的时候已经将key和iv转换为16进制串了,代码如下:
key和iv字符转位16进制串:1111111111111111 31313131313131313131313131313131
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions