使用者登入風險之表單輸入特徵評估

2021-10-23 01:57:29 字數 1933 閱讀 3536

使用者在填寫登陸表單時,每次輸入使用者名稱密碼或者驗證碼的所花費的時間是存在一定的規律的。多次正常輸入在二維座標系(使用者名稱,密碼),會呈現乙個圓形,三維座標系(使用者名稱,密碼,驗證碼)則會呈現乙個球形,多維則亦然。

評估當前使用者輸入如果不在正常輸入範圍內,則說明此次登陸存在一定的風險。

計算步驟:

歐氏距離

n點兩兩組合

評估資料

/**

* 使用者登陸輸入特性

*/public class featureevaluate

return sum;

}).get())//所有座標值的和

.map(s -> (s * 1.0) / historyfeature.size())

.collect(collectors.tolist());

//圓心字串形式

string strcentervector = string.join(",", centervector.stream()

.map(s -> s + "")

.collect(collectors.tolist()));

system.out.println("圓心:"+strcentervector);//展示圓心

//2.計算兩兩特性距離

listdistancelist = new arraylist<>();

for (int i = 0; i < historyfeature.size(); i++)

}system.out.println("兩兩距離:"+distancelist);//展示距離

//3.對距離進⾏排序(公升序),取2/3處作為評估距離閾值 - threshold

listsorteddistancelist = distancelist.stream()

.sorted()

.collect(collectors.tolist());

double thresholddistance = sorteddistancelist.get(sorteddistancelist.size() * 2 / 3);

system.out.println("半徑:" + thresholddistance);

//4.計算當前輸入特性與圓心的距離

double distance = distance(loginfeature, centervector.toarray(new double[0]));

system.out.println("當前輸入與圓心的距離:" + distance);

return distance > thresholddistance;

}/**

* 計算兩點距離

* @param v1

* @param v2

* @return

*/public double distance(double v1,double v2)

return math.sqrt(sum);

}//測試

public static void main(string args) );

latestinputfeatures.add(new double);

latestinputfeatures.add(new double);

latestinputfeatures.add(new double);

latestinputfeatures.add(new double);

inputfeatureevaluate.doeval(new double,latestinputfeatures);}}

表單和使用者輸入

記住 php 嵌入到html檔案中,檔案只有儲存為php格式才能在服務端正常執行。如果在客戶端執行,瀏覽器只能識別html 不能識別php 再簡單一點來說,伺服器端能執行php檔案中的html 不能執行html檔案中的php 客戶端只會執行html 無 件儲存為什麼格式。echo echo name...

PHP學習之 PHP 表單和使用者輸入

php 的 get 和 post 用於檢索表單中的值,比如使用者輸入。上面的 html 頁面例項包含了兩個輸入框和乙個提交按鈕。當使用者填寫該表單並單擊提交按鈕時,表單的資料會被送往 welcome.php 這個檔案。welcome post name you are post age years ...

SharePoint研究之表單登入配置

本文將演示sharepoint怎樣配置表單 form 登入,後續文章將研究 無密碼登入 程式設計新增使用者組 程式設計新增使用者 程式設計新增資料夾 程式設計分享資料夾 許可權分配 等。知識點 sharepoint sql server 登入驗證 1.配置資料庫 下面是採用系統框架的命令新增的資料庫...