diff --git a/src/main/java/nlib/sch/util/NlibCmmUtil.java b/src/main/java/nlib/sch/util/NlibCmmUtil.java
index b1e4d586..2c718228 100644
--- a/src/main/java/nlib/sch/util/NlibCmmUtil.java
+++ b/src/main/java/nlib/sch/util/NlibCmmUtil.java
@@ -172,14 +172,6 @@ public class NlibCmmUtil {
Matcher matcher = pattern.matcher(str);
return matcher.find();
}
- public static String generateRandomString(String allowed, int length) {
- Random random = new Random();
- StringBuilder sb = new StringBuilder(length);
- for (int i = 0; i < length; i++) {
- sb.append(allowed.charAt(random.nextInt(allowed.length())));
- }
- return sb.toString();
- }
public static String getIpAddress(HttpServletRequest req) {
String ipAddress = "";
if (req.getHeader("X-Forwarded-For") == null) {
@@ -317,59 +309,6 @@ public class NlibCmmUtil {
str = map.get(key)+"";
return str;
}
- @SuppressWarnings("rawtypes")
- public static Integer getInteger(Map map, String key) {
- Integer value = null;
- if (isEmpty(map, key)) return value;
- try {
- value = new Integer(map.get(key)+"");
- } catch (NumberFormatException e1) {
- LOGGER.error("fail in getInteger() key="+key+", map="+map, e1);
- } catch (Exception e2) {
- LOGGER.error("fail in getInteger() key="+key+", map="+map, e2);
- }
- return value;
- }
- @SuppressWarnings("rawtypes")
- public static BigDecimal getBigDecimal(Map map, String key) {
- BigDecimal value = null;
- if (isEmpty(map, key)) return value;
-
- try {
- value = new BigDecimal(map.get(key)+"");
- } catch (NumberFormatException e1) {
- LOGGER.error("fail in getBigDecimal() key="+key+", map="+map, e1);
- } catch (Exception e2) {
- LOGGER.error("fail in getBigDecimal() key="+key+", map="+map, e2);
- }
- return value;
- }
- public static String getPassStr() {
- String str = "";
- Random r = new Random();
- for(int i = 0; i < 10; i++){
- char lowerStr = (char)(r.nextDouble() * 26 + 97);
- if(i%2 == 0){
- str += (int)(r.nextDouble() * 10);
- }else{
- str += lowerStr;
- }
- }
- return str;
- }
- public static String getPassStr(int cnt) {
- String str = "";
- Random r = new Random();
- for(int i = 0; i < cnt; i++){
- char lowerStr = (char)(r.nextDouble() * 26 + 97);
- if(i%2 == 0){
- str += (int)(r.nextDouble() * cnt);
- }else{
- str += lowerStr;
- }
- }
- return str;
- }
public static String getIp(HttpServletRequest request) throws IOException, InvocationTargetException, SQLException, Exception {
String ip = request.getHeader("X-Forwarded-For");
@@ -392,45 +331,6 @@ public class NlibCmmUtil {
return ip;
}
- public static boolean checkIPMatching(String pattern, String address)
- {
- if (pattern.equals("*.*.*.*") || pattern.equals("*"))
- return true;
-
- String[] mask = pattern.split("\\.");
- String[] ip_address = address.split("\\.");
- for (int i = 0; i < mask.length; i++)
- {
- if (mask[i].equals("*") || mask[i].equals(ip_address[i]))
- continue;
- else if (mask[i].contains("-"))
- {
- byte min = Byte.parseByte(mask[i].split("-")[0]);
- byte max = Byte.parseByte(mask[i].split("-")[1]);
- byte ip = Byte.parseByte(ip_address[i]);
- if (ip < min || ip > max)
- return false;
- }
- else
- return false;
- }
- return true;
- }
- public static String getRandomNum(int size) {
- String strRandom = "";
- Random rand = new Random();
- for (int i = 0; i < size; i++) {
- strRandom += String.valueOf(rand.nextInt(10));
- }
- return strRandom;
- }
- public static boolean isMobile(final HttpServletRequest req) {
- String ua = StringUtils.defaultString(req.getHeader("User-Agent"), "").toLowerCase();
- if (ua.indexOf(Constant.ANDROID) > -1 || ua.indexOf(Constant.IOS) > -1 || ua.indexOf("mobile") > -1) {
- return true;
- }
- return false;
- }
public static void setNfsPathModelMap(HttpServletRequest req, ModelMap modelMap){
// ams 경로
String nfsNasPath = getPropertyStr(Constant.NFS_NAS_KEY);
diff --git a/src/main/java/nlib/user/service/impl/MemberServiceImpl.java b/src/main/java/nlib/user/service/impl/MemberServiceImpl.java
index 991b1d5f..9ea6df95 100644
--- a/src/main/java/nlib/user/service/impl/MemberServiceImpl.java
+++ b/src/main/java/nlib/user/service/impl/MemberServiceImpl.java
@@ -1,8 +1,10 @@
package nlib.user.service.impl;
+import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
@@ -89,7 +91,7 @@ public class MemberServiceImpl implements MemberService
*/
public String numberGen(int len, int dupCd ) {
- Random rand = new Random();
+ SecureRandom rand = new SecureRandom();
String numStr = ""; //난수가 저장될 변수
for(int i=0;i