Docsity

Solution for Homework 1 - Security in Computing | CIS 3360, Assignments of Computer Science

Toggle sidebar
bg1
CIS 3360 Homework 1
Due Date: August 30
Worth: 3%
Q1: In the following program, a pseudo code is given. Give a trace of the program and
explain what happens at each step. Explain what this program does. (15 points)
Program V:=
{
1234567;
Subroutine infect-executable:=
{
loop: file = random-executable; // select a random executable file
if (first line of file = 1234567)
then goto loop;
else prepend V to file;
}
Sub-routine display-message:=
{
count = 1000;
do while(count is not equal to 0)
{
if (count is 0)
then exit from sub-routine display-message;
else if(count is between 1 to 997)
{
file = random-executable;
execute simultaneously as many occurrences of the file as the
value of count;
}
else if(count is 998 or 999)
{
file = random-executable;
delete ith line of file such that i = count;
}
else if(count is 1000)
{
file = random-executable;
change every occurrence of the character s with the character a;
}
count = count -1;
pf2

Partial preview of the text

Download Solution for Homework 1 - Security in Computing | CIS 3360 and more Assignments Computer Science in PDF only on Docsity!

CIS 3360 Homework 1 Due Date: August 30 Worth: 3% Q1 : In the following program, a pseudo code is given. Give a trace of the program and explain what happens at each step. Explain what this program does. (15 points) Program V:= { 1234567; Subroutine infect-executable:= { loop: file = random-executable; // select a random executable file if (first line of file = 1234567) then goto loop; else prepend V to file; } Sub-routine display-message:= { count = 1000; do while(count is not equal to 0) { if (count is 0) then exit from sub-routine display-message; else if(count is between 1 to 997) { file = random-executable; execute simultaneously as many occurrences of the file as the value of count; } else if(count is 998 or 999) { file = random-executable; delete ith line of file such that i = count; } else if(count is 1000) { file = random-executable; change every occurrence of the character s with the character a; } count = count -1;

Subroutine trigger-pulled:= { if (time is between 10pm to 11pm) then set trigger-pulled to true; else set trigger-pulled = false; } Main-program-of-virus:= { infect-executable; if (trigger-pulled) then display-message; goto next; } next: } Q2 : Mention names of five viruses. Describe when they were discovered? Who discovered them? What are they named after? Briefly explain their working and damage. You are free to consult internet or any other reference. Do not copy-paste. Write in your own words. (15 points)