密码加密

密码存储加密

密码存储使用 HmacSM3 算法。

com.ujcms.cms.core.SecurityConfig

    @Bean
    public SecretKey secretKey(JwtProperties jwtProperties) {
        return new SecretKeySpec(jwtProperties.getSecret().getBytes(StandardCharsets.UTF_8), "HmacSM3");
    }

密码传输加密

在用户登录和用户注册时,前台使用 sm2 算法加密密码,后台使用 sm2 算法解密密码。

后台前端

src/views/LoginPage.vue

const password = sm2Encrypt(bean.value.password, publicKey);

后台后端

com.ujcms.cms.core.web.api.JwtAuthController

String rawPassword = Secures.sm2Decrypt(params.password, props.getClientSm2PrivateKey());
2025-10-31 06:38
Last Updated: 2025-10-31
CONTENTS
0791-85271700
QQ咨询:1779755751
QQ交流群:626599871
微信咨询
微信扫码咨询
微信交流群
微信交流群
Powered by UJCMS © 2010-2025 All Rights Reserved
QQ咨询
电话
微信
微信扫码咨询