亲宝软件园·资讯

展开

java弱口令检测

天天water 人气:0

java弱口令检测机制

1. 设计要求

2. 二级系统配置要求

3. 三级系统配置要求

4. java编码

package com.security.weakpassword; 
import java.lang.String; 
public class CheckPWD {
    /**
     * @brief   检测密码中字符长度
     * @param[in] password            密码字符串
     * @return  符合长度要求 返回true
     */
    public static boolean checkPasswordLength(String password) {
        boolean flag =false;
 
        if("".equals(config.MAX_LENGTH)) {
            if (password.length() >= Integer.parseInt(config.MIN_LENGTH)) {
                flag = true;
            }
        }else{
            if (password.length() >= Integer.parseInt(config.MIN_LENGTH) &&
                    password.length() <= Integer.parseInt(config.MAX_LENGTH)) {
                flag = true;
            }
        }
        return flag;
    }
 
    /**
     * @brief   检测密码中是否包含数字
     * @param[in] password            密码字符串
     * @return  包含数字 返回true
     */
    public static boolean checkContainDigit(String password) {
        char[] chPass = password.toCharArray();
        boolean flag = false;
        int num_count = 0;
 
        for (int i = 0; i < chPass.length; i++) {
            if (Character.isDigit(chPass[i])) {
                num_count++;
            }
        }
 
        if (num_count >= 1){
            flag = true;
        }
        return flag;
    }
 
    /**
     * @brief   检测密码中是否包含字母(不区分大小写)
     * @param[in] password            密码字符串
     * @return  包含字母 返回true
     */
    public static boolean checkContainCase(String password) {
        char[] chPass = password.toCharArray();
        boolean flag = false;
        int char_count = 0;
 
        for (int i = 0; i < chPass.length; i++) {
            if (Character.isLetter(chPass[i])) {
                char_count++;
            }
        }
 
        if (char_count >= 1) {
            flag = true;
        }
        return flag;
    }
 
    /**
     * @brief   检测密码中是否包含小写字母
     * @param[in] password            密码字符串
     * @return  包含小写字母 返回true
     */
    public static boolean checkContainLowerCase(String password) {
        char[] chPass = password.toCharArray();
        boolean flag = false;
        int char_count = 0;
 
        for (int i = 0; i < chPass.length; i++) {
            if (Character.isLowerCase(chPass[i])) {
                char_count++;
            }
        }
 
        if (char_count >= 1) {
            flag = true;
        }
        return flag;
    }
 
    /**
     * @brief   检测密码中是否包含大写字母
     * @param[in] password            密码字符串
     * @return  包含大写字母 返回true
     */
    public static boolean checkContainUpperCase(String password) {
        char[] chPass = password.toCharArray();
        boolean flag = false;
        int char_count = 0;
 
        for (int i = 0; i < chPass.length; i++) {
            if (Character.isUpperCase(chPass[i])) {
                char_count++;
            }
        }
 
        if (char_count >= 1) {
            flag = true;
        }
        return flag;
    }
 
    /**
     * @brief   检测密码中是否包含特殊符号
     * @param[in] password            密码字符串
     * @return  包含特殊符号 返回true
     */
    public static boolean checkContainSpecialChar(String password) {
        char[] chPass = password.toCharArray();
        boolean flag = false;
        int special_count = 0;
 
        for (int i = 0; i < chPass.length; i++) {
            if (config.SPECIAL_CHAR.indexOf(chPass[i]) != -1) {
                special_count++;
            }
        }
 
        if (special_count >= 1){
            flag = true;
        }
        return flag;
    }
 
    /**
     * @brief   键盘规则匹配器 横向连续检测
     * @param[in] password            密码字符串
     * @return  含有横向连续字符串 返回true
     */
    public static boolean checkLateralKeyboardSite(String password) {
        String t_password = new String(password);
        //将所有输入字符转为小写
        t_password = t_password.toLowerCase();
        int n = t_password.length();
        /**
         * 键盘横向规则检测
         */
        boolean flag = false;
        int arrLen = config.KEYBOARD_HORIZONTAL_ARR.length;
        int limit_num = Integer.parseInt(config.LIMIT_HORIZONTAL_NUM_KEY) ;
 
        for(int i=0; i+limit_num<=n; i++) {
            String str = t_password.substring(i, i+limit_num);
            String distinguishStr = password.substring(i, i+limit_num);
 
            for(int j=0; j<arrLen; j++) {
                String configStr = config.KEYBOARD_HORIZONTAL_ARR[j];
                String revOrderStr = new StringBuffer(config.KEYBOARD_HORIZONTAL_ARR[j]).reverse().toString();
 
                //检测包含字母(区分大小写)
                if ("enable".equals(config.CHECK_DISTINGGUISH_CASE)) {
                    //考虑 大写键盘匹配的情况
                    String UpperStr = config.KEYBOARD_HORIZONTAL_ARR[j].toUpperCase();
                    if((configStr.indexOf(distinguishStr) != -1) || (UpperStr.indexOf(distinguishStr) != -1)) {
                        flag = true;
                        return flag;
                    }
                    //考虑逆序输入情况下 连续输入
                    String revUpperStr = new StringBuffer(UpperStr).reverse().toString();
                    if((revOrderStr.indexOf(distinguishStr) != -1) || (revUpperStr.indexOf(distinguishStr) != -1)) {
                        flag = true;
                        return flag;
                    }
                }else {
                    if(configStr.indexOf(str) != -1) {
                        flag = true;
                        return flag;
                    }
                    //考虑逆序输入情况下 连续输入
                    if(revOrderStr.indexOf(str) != -1) {
                        flag = true;
                        return flag;
                    }
                }
            }
        }
        return flag;
    }
 
    /**
     * @brief   键盘规则匹配器 斜向规则检测
     * @param[in] password            密码字符串
     * @return  含有斜向连续字符串 返回true
     */
    public static boolean checkKeyboardSlantSite(String password) {
        String t_password = new String(password);
        t_password = t_password.toLowerCase();
        int n = t_password.length();
        /**
         * 键盘斜线方向规则检测
         */
        boolean flag = false;
        int arrLen = config.KEYBOARD_SLOPE_ARR.length;
        int limit_num = Integer.parseInt(config.LIMIT_SLOPE_NUM_KEY);
 
        for(int i=0; i+limit_num<=n; i++) {
            String str = t_password.substring(i, i+limit_num);
            String distinguishStr = password.substring(i, i+limit_num);
            for(int j=0; j<arrLen; j++) {
                String configStr = config.KEYBOARD_SLOPE_ARR[j];
                String revOrderStr = new StringBuffer(config.KEYBOARD_SLOPE_ARR[j]).reverse().toString();
                //检测包含字母(区分大小写)
                if ("enable".equals(config.CHECK_DISTINGGUISH_CASE)) {
 
                    //考虑 大写键盘匹配的情况
                    String UpperStr = config.KEYBOARD_SLOPE_ARR[j].toUpperCase();
                    if((configStr.indexOf(distinguishStr) != -1) || (UpperStr.indexOf(distinguishStr) != -1)) {
                        flag = true;
                        return flag;
                    }
                    //考虑逆序输入情况下 连续输入
                    String revUpperStr = new StringBuffer(UpperStr).reverse().toString();
                    if((revOrderStr.indexOf(distinguishStr) != -1) || (revUpperStr.indexOf(distinguishStr) != -1)) {
                        flag = true;
                        return flag;
                    }
                }else {
                    if(configStr.indexOf(str) != -1) {
                        flag = true;
                        return flag;
                    }
                    //考虑逆序输入情况下 连续输入
                    if(revOrderStr.indexOf(str) != -1) {
                        flag = true;
                        return flag;
                    }
                }
            }
        }
        return flag;
    }
 
    /**
     * @brief   评估a-z,z-a这样的连续字符
     * @param[in] password            密码字符串
     * @return  含有a-z,z-a连续字符串 返回true
     */
    public static boolean checkSequentialChars(String password) {
        String t_password = new String(password);
        boolean flag = false;
        int limit_num = Integer.parseInt(config.LIMIT_LOGIC_NUM_CHAR);
        int normal_count = 0;
        int reversed_count = 0;
 
        //检测包含字母(区分大小写)
        if ("enable".equals(config.CHECK_DISTINGGUISH_CASE)) {
 
        }else{
            t_password = t_password.toLowerCase();
        }
        int n = t_password.length();
        char[] pwdCharArr = t_password.toCharArray();
 
        for (int i=0; i+limit_num<=n; i++) {
            normal_count = 0;
            reversed_count = 0;
            for (int j=0; j<limit_num-1; j++) {
                if (pwdCharArr[i+j+1]-pwdCharArr[i+j]==1) {
                    normal_count++;
                    if(normal_count == limit_num -1){
                        return true;
                    }
                }
 
                if (pwdCharArr[i+j]-pwdCharArr[i+j+1]==1) {
                    reversed_count++;
                    if(reversed_count == limit_num -1){
                        return true;
                    }
                }
            }
        }
        return flag;
    }
 
    /**
     * @brief   评估aaaa,1111这样的相同连续字符
     * @param[in] password            密码字符串
     * @return  含有aaaa,1111等连续字符串 返回true
     */
    public static boolean checkSequentialSameChars(String password) {
        String t_password = new String(password);
        int n = t_password.length();
        char[] pwdCharArr = t_password.toCharArray();
        boolean flag = false;
        int limit_num = Integer.parseInt(config.LIMIT_NUM_SAME_CHAR);
        int count = 0;
        for (int i=0; i+limit_num<=n; i++) {
            count=0;
            for (int j=0; j<limit_num-1; j++) {
                if(pwdCharArr[i+j] == pwdCharArr[i+j+1]) {
                    count++;
                    if (count == limit_num -1){
                        return true;
                    }
                }
            }
        }
        return flag;
    }
 
    /**
     * @brief   评估密码中包含的字符类型是否符合要求
     * @param[in] password            密码字符串
     * @return  符合要求 返回true
     */
    public static boolean EvalPWD(String password) {
        if (password == null || "".equals(password)) {
            return false;
        }
        boolean flag = false;
 
        /**
         * 检测长度
         */
        if ("enable".equals(config.CHECK_PASSWORD_LENGTH)){
            flag = checkPasswordLength(password);
            if (!flag) {
                return false;
            }
        }
 
        /**
         * 检测包含数字
         */
        if ("enable".equals(config.CHECK_CONTAIN_DIGIT)){
            flag = checkContainDigit(password);
            if (!flag) {
                return false;
            }
        }
 
        /**
         * 检测包含字母(区分大小写)
         */
        if ("enable".equals(config.CHECK_DISTINGGUISH_CASE)){
            //检测包含小写字母
            if ("enable".equals(config.CHECK_LOWER_CASE)){
                flag = checkContainLowerCase(password);
                if (!flag) {
                    return false;
                }
            }
 
            //检测包含大写字母
            if ("enable".equals(config.CHECK_UPPER_CASE)){
                flag = checkContainUpperCase(password);
                if (!flag) {
                    return false;
                }
            }
        }else {
            flag = checkContainCase(password);
            if (!flag) {
                return false;
            }
        }
 
        /**
         * 检测包含特殊符号
         */
        if ("enable".equals(config.CHECK_CONTAIN_SPECIAL_CHAR)){
            flag = checkContainSpecialChar(password);
            if (!flag) {
                return false;
            }
        }
 
        /**
         * 检测键盘横向连续
         */
        if ("enable".equals(config.CHECK_HORIZONTAL_KEY_SEQUENTIAL)){
            flag = checkLateralKeyboardSite(password);
            if (flag) {
                return false;
            }
        }
 
        /**
         * 检测键盘斜向连续
         */
        if ("enable".equals(config.CHECK_SLOPE_KEY_SEQUENTIAL)){
            flag = checkKeyboardSlantSite(password);
            if (flag) {
                return false;
            }
        }
 
        /**
         * 检测逻辑位置连续
         */
        if ("enable".equals(config.CHECK_LOGIC_SEQUENTIAL)){
            flag = checkSequentialChars(password);
            if (flag) {
                return false;
            }
        }
 
        /**
         * 检测相邻字符是否相同
         */
        if ("enable".equals(config.CHECK_SEQUENTIAL_CHAR_SAME)){
            flag = checkSequentialSameChars(password);
            if (flag) {
                return false;
            }
        }
        return true;
    }
}
package com.security.weakpassword; 
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Properties; 
public class config {
    /**
     * 密码口令检测对应系统等级
     */
    public static String SYSTEM_GRADE;
 
    /**
     * 是否检测密码口令长度标识
     */
    public static String CHECK_PASSWORD_LENGTH;
    /**
     * 密码最小长度,默认为8
     */
    public static String MIN_LENGTH;
    /**
     * 密码最大长度,默认为20
     */
    public static String MAX_LENGTH;
 
    /**
     * 是否包含数字
     */
    public static String CHECK_CONTAIN_DIGIT;
    /**
     * 是否区分大小写
     */
    public static String CHECK_DISTINGGUISH_CASE;
    /**
     * 是否包含小写字母
     */
    public static String CHECK_LOWER_CASE;
    /**
     * 是否包含大写字母
     */
    public static String CHECK_UPPER_CASE;
    /**
     * 是否包含特殊符号
     */
    public static String CHECK_CONTAIN_SPECIAL_CHAR;
    /**
     * 特殊符号集合
     */
    public static String DEFAULT_SPECIAL_CHAR="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
    public static String SPECIAL_CHAR;
 
    /**
     * 是否检测键盘按键横向连续
     */
    public static String CHECK_HORIZONTAL_KEY_SEQUENTIAL;
    /**
     * 键盘物理位置横向不允许最小的连续个数
     */
    public static String LIMIT_HORIZONTAL_NUM_KEY;
    /**
     * 是否检测键盘按键斜向连续
     */
    public static String CHECK_SLOPE_KEY_SEQUENTIAL;
    /**
     * 键盘物理位置斜向不允许最小的连续个数
     */
    public static String LIMIT_SLOPE_NUM_KEY;
 
    /**
     * 是否检测逻辑位置连续
     */
    public static String CHECK_LOGIC_SEQUENTIAL;
    /**
     * 密码口令中字符在逻辑位置上不允许最小的连续个数
     */
    public static String LIMIT_LOGIC_NUM_CHAR;
 
    /**
     * 是否检测连续字符相同
     */
    public static String CHECK_SEQUENTIAL_CHAR_SAME;
    /**
     * 密码口令中相同字符不允许最小的连续个数
     */
    public static String LIMIT_NUM_SAME_CHAR;
 
    /**
     * 键盘横向方向规则
     */
    public static String[] KEYBOARD_HORIZONTAL_ARR = {
            "01234567890",
            "qwertyuiop",
            "asdfghjkl",
            "zxcvbnm",
    };
    /**
     * 键盘斜线方向规则
     */
    public static String[] KEYBOARD_SLOPE_ARR = {
            "1qaz",
            "2wsx",
            "3edc",
            "4rfv",
            "5tgb",
            "6yhn",
            "7ujm",
            "8ik,",
            "9ol.",
            "0p;/",
            "=[;.",
            "-pl,",
            "0okm",
            "9ijn",
            "8uhb",
            "7ygv",
            "6tfc",
            "5rdx",
            "4esz"
    };
    static {
        Properties prop = new Properties();
 
        try{
            //读取属性文件enc.properties
            InputStream in = new BufferedInputStream(new FileInputStream("password.properties"));
            prop.load(in);
            Iterator<String> it=prop.stringPropertyNames().iterator();
            while(it.hasNext()) {
                String key = it.next();
 
                if (key.equals("systemGrade")) {
                    SYSTEM_GRADE = prop.getProperty(key);
                }
 
                if (key.equals("checkPasswordLength")) {
                    CHECK_PASSWORD_LENGTH = prop.getProperty(key);
                }
                if (key.equals("limitPassMinLength")) {
                    MIN_LENGTH = prop.getProperty(key);
                }
                if (key.equals("limitPassMaxLength")) {
                    MAX_LENGTH = prop.getProperty(key);
                }
 
                if (key.equals("checkContainDigit")) {
                    CHECK_CONTAIN_DIGIT = prop.getProperty(key);
                }
                if (key.equals("checkContainUpperLowerCase")) {
                    CHECK_DISTINGGUISH_CASE = prop.getProperty(key);
                }
                if (key.equals("checkContainLowerCase")) {
                    CHECK_LOWER_CASE = prop.getProperty(key);
                }
                if (key.equals("checkContainUpperCase")) {
                    CHECK_UPPER_CASE = prop.getProperty(key);
                }
                if (key.equals("checkContainSpecialChar")) {
                    CHECK_CONTAIN_SPECIAL_CHAR = prop.getProperty(key);
                }
                if (key.equals("specialCharSet")) {
                    SPECIAL_CHAR = prop.getProperty(key);
                }
 
                if (key.equals("checkHorizontalKeySequential")) {
                    CHECK_HORIZONTAL_KEY_SEQUENTIAL = prop.getProperty(key);
                }
                if (key.equals("horizontalKeyLimitNum")) {
                    LIMIT_HORIZONTAL_NUM_KEY = prop.getProperty(key);
                }
                if (key.equals("checkSlopeKeySequential")) {
                    CHECK_SLOPE_KEY_SEQUENTIAL = prop.getProperty(key);
                }
                if (key.equals("slopeKeyLimitNum")) {
                    LIMIT_SLOPE_NUM_KEY = prop.getProperty(key);
                }
 
                if (key.equals("checkLogicSequential")) {
                    CHECK_LOGIC_SEQUENTIAL = prop.getProperty(key);
                }
                if (key.equals("logicLimitNum")) {
                    LIMIT_LOGIC_NUM_CHAR = prop.getProperty(key);
                }
 
                if (key.equals("checkSequentialCharSame")) {
                    CHECK_SEQUENTIAL_CHAR_SAME = prop.getProperty(key);
                }
                if (key.equals("sequentialCharNum")) {
                    LIMIT_NUM_SAME_CHAR = prop.getProperty(key);
                }
 
            }
            in.close();
 
            if("2".equals(SYSTEM_GRADE) || "3".equals(SYSTEM_GRADE) ) {
 
                if("".equals(CHECK_PASSWORD_LENGTH)){
                    CHECK_PASSWORD_LENGTH = "enable";
                    MIN_LENGTH = "8";
                    MAX_LENGTH = "20";
                }
                if("".equals(CHECK_CONTAIN_DIGIT)) {
                    CHECK_CONTAIN_DIGIT = "enable";
                }
                if("".equals(CHECK_DISTINGGUISH_CASE)) {
                    CHECK_DISTINGGUISH_CASE = "disable";
                }
                if("".equals(CHECK_LOWER_CASE)) {
                    CHECK_LOWER_CASE = "enable";
                }
                if("".equals(CHECK_UPPER_CASE)) {
                    CHECK_UPPER_CASE = "enable";
                }
                if("".equals(CHECK_CONTAIN_SPECIAL_CHAR)) {
                    if("2".equals(SYSTEM_GRADE)) {
                        CHECK_CONTAIN_SPECIAL_CHAR = "disable";
                    }else{
                        CHECK_CONTAIN_SPECIAL_CHAR = "enable";
                        if("".equals(SPECIAL_CHAR)) {
                            SPECIAL_CHAR = DEFAULT_SPECIAL_CHAR;
                        }
                    }
                }
 
                if("".equals(CHECK_HORIZONTAL_KEY_SEQUENTIAL)) {
                    CHECK_HORIZONTAL_KEY_SEQUENTIAL = "enable";
                    if("2".equals(SYSTEM_GRADE)) {
                        LIMIT_HORIZONTAL_NUM_KEY = "4";
                    }else{
                        LIMIT_HORIZONTAL_NUM_KEY = "3";
                    }
                }
 
                if("".equals(CHECK_SLOPE_KEY_SEQUENTIAL)) {
                    CHECK_SLOPE_KEY_SEQUENTIAL = "enable";
                    if("2".equals(SYSTEM_GRADE)) {
                        LIMIT_SLOPE_NUM_KEY = "4";
                    }else{
                        LIMIT_SLOPE_NUM_KEY = "3";
                    }
                }
 
                if("".equals(CHECK_LOGIC_SEQUENTIAL)) {
                    CHECK_LOGIC_SEQUENTIAL = "enable";
                    if("2".equals(SYSTEM_GRADE)) {
                        LIMIT_LOGIC_NUM_CHAR = "4";
                    }else{
                        LIMIT_LOGIC_NUM_CHAR = "3";
                    }
 
                }
                if("".equals(CHECK_SEQUENTIAL_CHAR_SAME)) {
                    CHECK_SEQUENTIAL_CHAR_SAME = "enable";
                    if("2".equals(SYSTEM_GRADE)) {
                        LIMIT_NUM_SAME_CHAR = "4";
                    }else{
                        LIMIT_NUM_SAME_CHAR = "3";
                    }
                }
            }else{
                SYSTEM_GRADE = "3";
                CHECK_PASSWORD_LENGTH = "enable";
                MIN_LENGTH = "8";
                MAX_LENGTH = "20";
                CHECK_CONTAIN_DIGIT = "enable";
                CHECK_LOWER_CASE = "enable";
                CHECK_UPPER_CASE = "enable";
                CHECK_CONTAIN_SPECIAL_CHAR = "enable";
                CHECK_HORIZONTAL_KEY_SEQUENTIAL = "enable";
                LIMIT_HORIZONTAL_NUM_KEY = "3";
                CHECK_SLOPE_KEY_SEQUENTIAL = "enable";
                LIMIT_SLOPE_NUM_KEY = "3";
                CHECK_LOGIC_SEQUENTIAL = "enable";
                LIMIT_LOGIC_NUM_CHAR = "3";
                CHECK_SEQUENTIAL_CHAR_SAME = "enable";
                LIMIT_NUM_SAME_CHAR = "3";
            }
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
}
import com.security.weakpassword.CheckPWD; 
/**
 * Created by xianbin
 */
public class TestDemo {
    public static void main(String[] args) {
        System.out.println("this is a test code");
 
        boolean flag = false;
        String[] testPass = {
                null,
                "",
                "123456",
                "12345678",
                "abcdefgh",
                "123abc456",
                "1231adf@",
                "12341adf@",
                "fdahuier243335ddfa#$*&",
                "aBcd1859d4!@",
                "zaq13edfgt#",
                "Bgt5sj4#"
        };
        for (int i = 0; i < testPass.length; i++) {
            System.out.printf("testpass[%d] = %s\n", i,testPass[i]);
            flag = CheckPWD.EvalPWD(testPass[i]);
            if (flag) {
                System.out.println("secret pass.\n");
            } else {
                System.out.println("secret failed.\n");
            }
        } 
    }
} 
 

5. 配置文件

#保护系统级别 系统级别分为二级系统和三级系统
#当systemGrade不为2或者3时,系统默认使用系统级别2的规则
#当systemGrade设置为2或者3时,其他选项若未配置,则按照默认值处理,具体默认值信息见每一项说明
systemGrade=2
 
#检测密码口令长度
#当checkPasswordLength为disable时,下面两项设置无效
#其他检测功能设置为disable时,对应设置项设置数据无效
#当系统级别为2或3时,checkPasswordLength默认为enable
#当系统级别为2或3时,limitPassMinLength默认为8,limitPassMaxLength默认为20
#是否检测密码口令长度,如为enable则检测,如为disable则不检测,如为空,
checkPasswordLength=enable
#允许密码口令最小长度
limitPassMinLength=8
#允许密码口令最大长度,如为空,则不设置上限
limitPassMaxLength=20
 
#是否包含数字、小写字母、大写字母、特殊符号
#当设置checkContainUpperLowerCase为enable时,区分大小写
#当系统级别为2时:checkContainDigit默认为enable,checkContainUpperLowerCase默认为disable
#当系统级别为2时,checkContainLowerCase默认为disable,checkContainUpperCase默认为disable
#当系统级别为2时,checkContainSpecialChar默认为disable
#当系统级别为3时:checkContainDigit默认为enable,checkContainUpperLowerCase默认为disable
#当系统级别为3时,checkContainLowerCase默认为disable,checkContainUpperCase默认为disable
#当系统级别为3时,checkContainSpecialChar默认为enable
#是否检测包含数字
checkContainDigit=enable
#是否检测包含大小写字母,区分密码口令大小写
checkContainUpperLowerCase = disable
#是否检测包含小写字母
checkContainLowerCase = enable
#是否检测包含大写字母
checkContainUpperCase = enable
#是否检测包含特殊符号
checkContainSpecialChar=disable
#支持自定义特殊符号集合
specialCharSet="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
 
#检测键盘按键连续 比如qwer、1qaz、0okm等
#允许横向最大连续num为7,最小为3
#允许斜向最大连续num为4,最小为3
#当系统级别为2时:checkHorizontalKeySequential默认为enable,horizontalKeyLimitNum默认为4
#当系统级别为2时,checkSlopeKeySequential默认为enable,slopeKeyLimitNum默认为4
#当系统级别为3时:checkHorizontalKeySequential默认为enable,horizontalKeyLimitNum默认为3
#当系统级别为3时,checkSlopeKeySequential默认为enable,slopeKeyLimitNum默认为3
#是否检测键盘横向连续 
checkHorizontalKeySequential=enable
#允许键盘横向连续最小数值,如为空,则设置为默认值
horizontalKeyLimitNum=4
#是否检测键盘斜向连续
checkSlopeKeySequential=enable
#允许键盘斜向连续最小数值,如为空,则设置为默认值
slopeKeyLimitNum=4
 
#检测逻辑位置连续 比如1234、abcd等
#当系统级别为2时,checkLogicSequential默认为enable,logicLimitNum默认为4
#当系统级别为3时,checkLogicSequential默认为enable,logicLimitNum默认为3
#是否检测逻辑位置连续
checkLogicSequential=enable
#允许逻辑位置连续最小数值,如为空,则设置为默认值
logicLimitNum=4
 
#检测相邻字符相同 比如aaaa、2222、@@@@等
#当系统级别为2时,checkSequentialCharSame默认为enable,sequentialCharNum默认为4
#当系统级别为3时,checkSequentialCharSame默认为enable,sequentialCharNum默认为3
#是否检测相邻字符相同
checkSequentialCharSame=enable
#允许相邻位置相同最小连续数,如为空,则设置为默认值
sequentialCharNum=4
 

以上为个人经验,希望能给大家一个参考,也希望大家多多支持。

加载全部内容

相关教程
猜你喜欢
用户评论