|
@@ -0,0 +1,48 @@
|
|
|
|
|
+package com.style24.core.support.util;
|
|
|
|
|
+
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+
|
|
|
|
|
+import com.gagaframework.web.util.GagaCryptoUtil;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 암호화 Util Class
|
|
|
|
|
+ * @author gagamel
|
|
|
|
|
+ * @since 2021. 1. 22
|
|
|
|
|
+ */
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+public class CryptoUtils {
|
|
|
|
|
+
|
|
|
|
|
+ // AES키
|
|
|
|
|
+ private static final String aesKey = "style24-tsit^^";
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * AES 암호화 처리
|
|
|
|
|
+ * @param rawValue - 원시문자열
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static String encryptAES(String rawValue) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ return GagaCryptoUtil.encryptAES(aesKey, rawValue);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error(e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return rawValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * AES 복호화 처리
|
|
|
|
|
+ * @param encodedValue - 암호화된 문자열
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static String decryptAES(String encodedValue) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ return GagaCryptoUtil.decryptAES(aesKey, encodedValue);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error(e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return encodedValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|