| Algorithm 1: Intrusion trace effort algorithm |
|
Input:
TimeInterval, SourceFilePath, TargetFilePath. Output: TargetFileData. 1. Read SourceFile using the class of BufferedReader; 2. Assign by SourceFile to the variables of Begin, Last, and Degree, whose types are respectively Stack < Integer >, Stack < Double >, Stack < Float >; 3. Set TimeInterval by expert and assign to the variable of Interval; 4. The time is initialized as follows: 5. public int getInitial(){ 6. int time = begin.get(0); 7. int result = time/5; 8. int initial = result*5; 9. return initial;} 10. The elementary intrusion effort is calculated as follows: 11. int time = getInitial(); 12. int ptime = time + (getInterval() − 1); 13. for (int j = 0; j < begin.size(); j++){ 14. if ((begin.get(j) <= ptime&&begin.get(j) > time)||(begin.get(j) > (time + 60)&&begin.get(j) < 60)){ 15. rate++; 16. The algorithm to calculate the occurrence number of different threat level attacks; 17. The algorithm to calculate the threat degree of elementary intrusion; 18. The algorithm to calculate the elementary intrusion effort integrating last and threat degree; 19. e += ElemEffort;} 20. else { 21. if (rate ! = 0){ 22. Calculate tracep;} 23. else { 24. tracep = 0;} 25. Store the values of tracep and rate on the stack; 26. Based on the time windows, the elementary intrusions is divided into the intrusion trace. The intrusion trace effort is calculated as follow: 27. Write into the file of TargetFile; 28. Initialization the parameters of rate, e, unknown, lowest, low, medium, high is 0; 29. time = ptime; 30. ptime += getInterval(); 31. if (ptime > 59) { 32. time = time - 60; 33. ptime = ptime - 60;} 34. j =j - 1;}} |