瀏覽代碼

Initial Release

gagamel 5 年之前
父節點
當前提交
b89cbf95b5
共有 1 個文件被更改,包括 48 次插入0 次删除
  1. 48 0
      src/main/java/com/style24/core/support/util/CryptoUtils.java

+ 48 - 0
src/main/java/com/style24/core/support/util/CryptoUtils.java

@@ -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;
+	}
+
+}