Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解密功能优化建议 #35

Open
Wnltc opened this issue Jan 10, 2023 · 0 comments
Open

解密功能优化建议 #35

Wnltc opened this issue Jan 10, 2023 · 0 comments

Comments

@Wnltc
Copy link

Wnltc commented Jan 10, 2023

大佬好,对于解密功能的实现,是不是可以考虑给每个加密算法的实现类(AesUtil)加入一个参数,比如isCache=false,然后根据这个参数来判断是否支持直接解密。

  1. 如果是对称加密算法,则将该参数设为false,解密时使用密钥进行解密
  2. 如果是rsa或者execjs,则根据用户配置来决定该参数是false还是true

比如:
如果用户配置了私钥,那么就将该参数设为false,加密时直接加密返回,不做其他操作,解密时使用私钥进行解密;
如果没有配置私钥,则将该参数设为true,加密时将明文写入数据库,解密时从数据库中提取明文

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant