CSCL Lab Final

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Nagarjuna College Of Information Technology

Sankhamul, Lalitpur

Lab Report of Computer Security and Cyber Law

Submitted By: Submitted To:


Powel Nepali Abishek G.C
BIM SIXTH Semester
Symbol No: 9965/19
Lab No. Title/Question Submission Remarks
Date

1. Generate RSA key using OpenSSL

2. Java Program to demonstrate Ceasar Cipher

3. Java Program to demonstrate Rail Fence Cipher

4. Java Program to demonstrate Message Digest


Example

Case:- Story Of Melissa Virus

a. Introduction and identification of problem


faced

b. Analysis of the problem

c. Detection Criteria

d. Recommendation for solving problem

e. Implementation plan for executing


recommendation
f. Finding

g. Conclusion
 Lab-2
Write a program to demonstrate Ceaser Cipher.
package cscl;
import java.util.*;
public class CSCL {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Ceaser_Cipher cipher = new Ceaser_Cipher();
System.out.print("Enter plaintext : ");
String ip = sc.next();
System.out.print("Enter key : ");
int key = sc.nextInt();
cipher.encrypt(ip,key);
cipher.decrypt(key);
}
}
class Ceaser_Cipher{
String total_character = "abcdefghijklmnopqrstuvwxyz",ciphertext="";
char encrypt = 0;
int encrypt_pos;
void encrypt(String plaintext,int key){
plaintext = plaintext.toLowerCase();
for(char encryption_text : plaintext.toCharArray()){
int pos= total_character.indexOf(encryption_text);
encrypt_pos = (pos + key) %26;
encrypt = total_character.charAt(encrypt_pos);
ciphertext +=encrypt;
}
System.out.println("Cipher Text : "+ciphertext);
}
void decrypt(int key){
char decrypt = 0;
String plaintext ="";
int decrypt_pos,pos=0;
for(char decryption_text : ciphertext.toCharArray()){
pos = total_character.indexOf(decryption_text);
decrypt_pos = (pos +26 - key) %26;
decrypt = total_character.charAt(decrypt_pos);
plaintext+=decrypt;
}
System.out.println("Plain Text : "+plaintext);
}
}
Output:-
 Lab-3
Write a program to demonstrate Rail Fence Cipher

package cscl;
import java.util.*;
public class Deonstrate_rail_fence_cipher {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter plaintext : ");
String ip = sc.next();
System.out.print("Enter key : ");
int key = sc.nextInt();
Rail_fench rail = new Rail_fench();
rail.encryption(ip, key);
}
}
class Rail_fench{
void encryption(String text, int key){
String encrypted_text = "";
boolean check = false;
int j=0,row=key,col = text.length();
char [][] a = new char[row][col];
for(int i=0; i< col; i++){
if(j==0 || j==key-1){
check =!check;
}
a[j][i] = text.charAt(i);
if(check){
j++;
} else{
j--;
}
}
for(int i=0; i<row; i++){
for(int k=0; k<col; k++){
System.out.print(Character.toUpperCase(a[i][k])+" ");
}
System.out.println("");
}
}
}

Output:-
 Lab-4
Write a program to demonstrate Message Digest Example

package cscl;
import java.security.*;
import java.util.*;

public class Demonstrate_msg_digest {


public static void main(String[] args) throws
NoSuchAlgorithmException {
Scanner sc = new Scanner(System.in);
System.out.print("Enter plaintext : ");
String ip = sc.next();
Message_Digest md = new Message_Digest();
md.display(ip);
}
}

class Message_Digest {
void display(String data) throws NoSuchAlgorithmException{
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(data.getBytes());
byte[] digest = md.digest();
StringBuffer sb = new StringBuffer();
for(byte b: digest){
sb.append(String.format("%02x",b & 0xff));
}
System.out.println("SHA-256 Hash : "+sb.toString());
}
}

Output:-
The Melissa Virus, 1999

Introduction and identification of problem faced:


The Melissa virus is a notorious
computer virus that emerged in the late 1990s. It was created by David L. Smith and named
after a stripper in Florida. Melissa was one of the first widely spread email-based viruses and
caused significant damage and disruption to computer systems around the world. Melissa
was designed to target computers running Microsoft Word 97 and Word 2000. It was
distributed via infected Word documents sent as email attachments. The virus exploited the
macro functionality in Word, which allowed it to automatically execute its malicious code
when the infected document was opened. Once a computer was infected, Melissa had two
main effects. First, it sent itself to the first 50 contacts found in the victim's Microsoft Outlook
address book, spreading rapidly through email. Second, it also disabled various safeguards
and antivirus software on the infected computer, making it vulnerable to other types of
malware.

Analysis of problem:
The Melissa virus was distributed as an email attachment that, when
opened, disabled a number of safeguards in Word 97 and Word 2000. The Melissa virus,
emerging in the late 1990s, posed a significant cyber security threat through its clever
combination of social engineering and software exploitation. It spread primarily via email
attachments, capitalizing on users' curiosity and trust by masquerading as a valuable
document containing passwords. Upon opening, it took advantage of vulnerabilities in
Microsoft Word 97 and 2000, executing a malicious Visual Basic script embedded within the
document. Melissa's rapid email-spreading capabilities allowed it to automatically send itself
to the first 50 contacts in the victim's Microsoft Outlook address book, using deceptive
subject lines and body text to appear legitimate. Moreover, the virus went beyond replication;
it also disabled vital safeguards and antivirus software, rendering infected systems vulnerable
to other malware threats. Despite its destructive potential, Melissa did not target data theft or
confidentiality breaches. Instead, it focused on disruption and system instability, underlining
the critical role of user education and technical defenses in modern cyber security. In addition,
if the user had the Microsoft Outlook email program, the virus sent itself to the first 50 people
in the infected user's address book. It arrived with the subject line, "Important Message from
[the sender's username]," and body text that read: "Here is that document you asked for ...
don't show anyone else." The attachment was often named List.Doc.
The attached file itself was supposed to contain a list of passwords for various websites that
required memberships, but instead, it contained a Visual Basic script. That script copied the
infected file into a template file used by Word for custom settings and default macros. Its
rapid spread and replication could lead to system instability and performance issues. The
Melissa virus, which emerged in 1999, was primarily a mass-mailing worm that infected
computers through email attachments. It did not specifically target or cause a loss of
confidentiality.
If the recipient opened the attachment, the infecting file was read to computer storage. The
virus then created an Outlook object using the Visual Basic code, read the first 50 names in
each Outlook Global Address Book, and sent out the same infected document and email.

Detection criteria:
Effective detection criteria for the Melissa virus encompass a multi-
layered approach involving antivirus software, email filters, and security solutions. These
measures work in concert to identify the virus based on signature patterns, email distribution
behavior, and any interference with antivirus software, ultimately bolstering an organization's
ability to detect and respond to email-based threats like Melissa. Antivirus software scans
incoming email attachments and examines the content for any suspicious or malicious
macros. If a document contains macros that match the signature or behavior patterns
associated with the Melissa virus, it raises an alert or quarantines the file. Email filters and
security solutions monitor outgoing email traffic for signs of mass distribution or unusual
email behavior. If an email is detected to be spreading rapidly to a large number of recipients,
it may indicate the presence of the Melissa virus or a similar email-borne threat. Melissa had
the capability to disable certain antivirus software installed on infected systems. If the
antivirus software detects any unauthorized modifications, unusual behaviors, or sudden
termination, it may trigger an alert indicating a potential infection or tampering by a virus like
Melissa.
Recommendation for solving problem:
• Verify the authenticity of email senders before opening attachments, especially if the email
requests
sensitive information or financial transactions.
• Avoid opening executable files included as attachments.
• Set up separate servers or network segments for external-facing resources and internal
organizational
resources.
• Scan an email message's attachments for malware.
• Use desktop and network firewalls.
• Implement intrusion detection and prevention systems (IDPS) to monitor network traffic for
suspicious activities.
• Regularly monitor network activity and evaluate the effectiveness of security policies and
controls.
• Continuously update and improve security measures based on findings and emerging
threats.
• Develop and maintain an incident response plan outlining steps to take in case of a security
incident.
• Ensure that employees know how to report security incidents promptly.

Implementation plan for executing recommendation


1. Develop or update comprehensive security policies and guidelines.
2. Implement network monitoring tools to detect unusual activity.
3. Utilize both desktop and network firewalls to restrict unauthorized access.
4. Promote awareness about how to spot and avoid email based phishing attacks, social
engineering,
and many other modern hacker attack methods.
5. Train employees to verify sender authenticity before opening attachments.
6. Develop and maintain an incident response plan outlining steps to take in case of a security
incident.
7. Implement Intrusion Detection System to monitor network traffic for suspicious activities.
Finding
The Melissa Virus had significant impacts on the confidentiality, integrity, availability,
accountability, and authenticity of computer systems and data, here’s how it affected each
aspects:
1. Authenticity: The virus manipulated the authenticity of email messages, disguising itself as
a trusted communication from the recipient's address book. This highlighted the need for
robust authentication mechanisms to ensure the legitimacy of senders and emails.
2. Availability: Melissa's rapid spread through email systems disrupted the availability of
email services for numerous organizations. This incident highlighted the importance of
ensuring the availability of critical systems and services through robust security measures
and disaster recovery plans.
3. Integrity: The virus altered the integrity of documents by inserting malicious code into
seemingly innocuous attachments. This highlighted the significance of maintaining the
integrity of data and documents through measures like digital signatures and checksums.
4. Confidentiality: Melissa compromised the confidentiality of email communications by
sending itself to the first 50 contacts in the infected user's address book. This breach of
confidentiality emphasized the requirement for secure email communication channels and
encryption methods to protect sensitive information.
5. Availability: Melissa's rapid spread through email systems disrupted the availability of
email services for numerous organizations. This incident highlighted the importance of
ensuring the availability of critical systems and services through robust security measures
and disaster recovery plans

Conclusion:
The Melissa Virus incident of 1999 stands as a stark reminder of the ever-present cyber
security threats in our digital age. Beyond its technical impact, it underscores the potency of
social engineering tactics, exploiting human curiosity and trust to infiltrate systems. This
event highlights the necessity for continuous user education in recognizing and thwarting
such tactics. Moreover, the virus's rapid propagation through email systems, causing
widespread disruptions, emphasizes the critical importance of robust email filtering and
security measures for prompt threat detection and mitigation. The exploitation of software
vulnerabilities in Microsoft Word and Outlook serves as a compelling case for the timely
application of software updates and patches, underlining the shared responsibility of
individuals and organizations in maintaining proactive security.
Reference
1. Gillis, A. S. (2021, December 13). Melissa virus. Retrieved from TechTarget Network:
https://www.techtarget.com/searchsecurity/definition/Melissa-virus

2. Gillis, A. S. (2021, December 13). Melissa virus. Retrieved from TechTarget Network:
https://www.techtarget.com/searchsecurity/definition/Melissa-virus
3. Officer, U. S. (1999, april 15). The Melissa Computer. Retrieved from GOA:
https://www.govinfo.gov/content/pkg/GAOREPORTS-T-AIMD-99-146/pdf/GAOREPORTS-T-
AIMD-99-146

You might also like