/*** 類名稱: displayutil
* 類描述: 敏感資訊掩碼規則
*/public class displayutil
return wordmask(mobile, 3, 4, "*");
}/**
* **號碼顯示區號及末4位,中間用*號隱藏代替,如:010****4213
** @param telephone
* @return
*/public static string displaytelephone(string telephone)
string result;
if (telephone.length() > 8) else
} else
return result;
}/**
* 身份證號顯示首3末3位,中間用*號隱藏代替,如:421*******012
** @param idcard
* @return
*/public static string displayidcard(string idcard)
return wordmask(idcard, 3, 3, "*");
}/**
* 銀行卡顯示首3末3位,中間用*號隱藏代替,如:622********123
** @param cardno
* @return
*/public static string displaybankcard(string cardno)
return wordmask(cardno, 3, 3, "*");
}/**
* 郵箱像是前兩位及最後一位字元,及@後郵箱網域名稱資訊,如:ye****[email protected]
** @param email
* @return
*/public static string displayemail(string email)
string temp = email.split("@");
return wordmask(temp[0], 1, 1, "*") + "@" + temp[1];
}/**
* 三個字掩碼,如:張曉明 如:張*明
* 兩個字掩碼,如:小明 如:*明
* 多個字掩碼,如:張小明明 如:張**明
** @param name
* @return
*/public static string displayname(string name)
if (name.length() == 2)
return wordmask(name, 0, 1, "*");
}/**
* cvv全隱藏,如: ***
** @param cvv
* @return
*/public static string displaycvv(string cvv)
return "***";
}/**
* expdate全隱藏,如: ****
** @param expdate
* @return
*/public static string displayexpdate(string expdate)
return "****";
}/**
* 對字串進行脫敏處理 --
** @param word 被脫敏的字元
* @param startlength 被保留的開始長度 前余n位
* @param endlength 被保留的結束長度 後余n位
* @param pad 填充字元
* */
public static string wordmask(string word,int startlength ,int endlength,string pad)
string startstr = word.substring(0, startlength);
string endstr = word.substring(word.length() - endlength, word.length());
return startstr + org.apache.commons.lang3.stringutils.leftpad("", word.length() - startlength - endlength, pad) + endstr;
}}
敏 感 信 息 掃 描 工 具 使 用 對 比
滲 透 測 試 過 程 中 經 常 需 要 對 網 站 進 行 全 面 的 信 息 收 集 掃 描 網 站 是 否 存 在 敏 感 信 息 文 件 如 phpinfo 日 志 文 件 洩 漏 會 極 大的 方 便我 們 進 一 步 的 滲 透 測 試 特 別 是 對 於 一 些 403 網 站 通 ...
蘭訊配置工具資訊規則
這裡介紹一下蘭訊的配置工具中配置資訊的規則,正是因為有了這個配置工具,使得軟體配置修改變得更加容易上手。config sub,a b 這個能夠建立乙個左側的目錄。a為目錄的名字,b是解釋這個目錄是幹什麼用的,但是不會顯示出來.圖示如下 config check,a b c,d,e 這個是乙個選項。a...
Android工具類 獲取螢幕資訊類
獲取螢幕的寬高,狀態列高度,截圖等 package com.duanlian import android.content.context import android.graphics.bitmap import android.graphics.rect import android.util....