|
|
@@ -155,7 +155,7 @@ public class CryptoUtils {
|
|
|
String encryptedValue = "";
|
|
|
|
|
|
try {
|
|
|
- if (rawValue != null) {
|
|
|
+ if (StringUtils.isNotBlank(rawValue)) {
|
|
|
final Cipher cipher = Cipher.getInstance("AES"); // Cipher.getInstance("AES/ECB/PKCS5Padding")와 같음. ECB 모드의 경우 cipher.init 시 IvParameterSpec을 넣음 안 된다.
|
|
|
cipher.init(Cipher.ENCRYPT_MODE, generateMysqlAESKey("UTF-8"));
|
|
|
encryptedValue = new String(Hex.encodeHex(cipher.doFinal(rawValue.getBytes("UTF-8")))).toUpperCase();
|