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

[mod]增强 AES 加解密算法的工具类 #53

Merged
merged 2 commits into from
Apr 24, 2020

Conversation

changhr2013
Copy link

@changhr2013 changhr2013 commented Apr 24, 2020

主要增强了 AES 加解密的工具类

  1. 工具类添加了生成随机密钥的方法,使用 java.crypto.KeyGenerator 密钥生成器来生成特定于 AES 算法参数集的随机密钥,应该强制用户使用此方式生成自己的密钥,这有助于防止用户使用弱随机密钥带来的安全隐患。
  2. 增加了对 AES/ECB/NoPadding 的支持,当使用 NoPadding 方式填充时,默认使用 ZeroPadding,给用户带来更多的选择性。

future:

可以考虑为密文增加完整性校验,因为 ECB 方式的特点,密文内容很容易被替换、重排、删除和重放,因此可以考虑后面支持 https 常见的带 mac 校验的 AES-GCM 算法。

@yinjihuan
Copy link
Owner

真细致,单词拼错了都发现了,赞

@yinjihuan yinjihuan merged commit 873ce6a into yinjihuan:master Apr 24, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants