Project scenario:
提示:这里简述项目相关背景:
springboot+linux
Problem Description
提示:这里描述项目中遇到的问题:
AES encryption is performed on file upload and AES decryption is performed when reading. The key exists in a custom file. After the local code is written, everything is normal, but after deploying to the server, it reportsInvalid AES key length: 33 bytes
Cause Analysis:
Tip: Fill in the analysis of the question here:
Now that this problem has been reported, first confirm whether there is a problem with the key. After outputting the content, it is found that it will automatically wrap
solution:
Tip: Fill in the specific solution to the problem here:
The obtained key content is formatted replaceAll("\n", "")
and then observed, everything is normal.