Created
February 17, 2015 04:28
-
-
Save shlee322/548dc298661e94e3495e to your computer and use it in GitHub Desktop.
개인정보의 기술적·관리적 보호조치 기준에 따른 비밀번호 작성 규칙 체크 함수
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function check_password(pwd) { | |
// Copyright (c) 2015 Lee Sahghyuck <shlee322@elab.kr> | |
// MIT License (http://opensource.org/licenses/mit-license.php) | |
// Author : Lee Sahghyuck <shlee322@elab.kr> | |
// Date : 2015.02.17 | |
var char_type = 0; | |
if (/[a-z]/.test(pwd)) char_type = char_type + 1; | |
if (/[A-Z]/.test(pwd)) char_type = char_type + 1; | |
if (/[0-9]/.test(pwd)) char_type = char_type + 1; | |
if (/[~!@#$%\^&*()_+`\-={}|[\]\\:";'<>?,./]/gi.test(pwd)) char_type = char_type + 1; | |
return !(char_type < 2 || (char_type == 2 && pwd.length < 10) || pwd.length < 8); | |
} | |
// check_password('testtest') -> false | |
// check_password('testtest123') -> true | |
// check_password('asdf@qw1') -> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
개인정보의 기술적·관리적 보호조치 기준
제 4조(접근통제)
⑦ 정보통신서비스 제공자등은 이용자가 안전한 비밀번호를 이용할 수 있도록 비밀번호 작성규칙을 수립하고, 이행한다.
⑧ 정보통신서비스 제공자등은 개인정보취급자를 대상으로 다음 각 호의 사항을 포함하는 비밀번호 작성규칙을 수립하고, 이를 적용·운용하여야 한다.