Question

In: Computer Science

Subject: Encryption in Malware/Viruses o make an Introduction on this subject o make a Methodology/ Algorithm...

Subject: Encryption in Malware/Viruses

o make an Introduction on this subject

o make a Methodology/ Algorithm on this subject
o setup a Coding / Setup on this subject
o and Application

o also add Reference

Solutions

Expert Solution

Encryption prevents viruses and other forms of malicious users from modifying, renaming, deleting, moving and reading the documents as well. Encryption is the most effective tool that truly provides the last line of defense against computer hackers. Unauthorized local users as well as online users will be unable to modify or access data. Prevention of unauthorized access is equally important to encryption of valuable data as well.

Malware (a portmanteau for malicious software) is any software intentionally designed to cause damage to a computer, server, client, or computer network (by contrast, software that causes unintentional harm due to some deficiency is typically described as a software bug) A wide variety of malware types exist, including computer viruses, worms, Trojan horses, ransomware, spyware, adware, rogue software, and scareware.

Programs are also considered malware if they secretly act against the interests of the computer user. For example, at one point Sony music Compact discs silently installed a rootkit on purchasers' computers with the intention of preventing illicit copying, but which also reported on users' listening habits, and unintentionally created extra security vulnerabilities

A range of antivirus software, firewalls and other strategies are used to help protect against the introduction of malware, to help detect it if it is already present, and to recover from malware-associated malicious activity and attacks.  Therefore we required the need of encryption.

RSA algorithm is asymmetric cryptography algorithm. Asymmetric actually means that it works on two different keys i.e. Public Key and Private Key. As the name describes that the Public Key is given to everyone and Private key is kept private.

An example of asymmetric cryptography :

  1. A client (for example browser) sends its public key to the server and requests for some data.
  2. The server encrypts the data using client’s public key and sends the encrypted data.
  3. Client receives this data and decrypts it.

Since this is asymmetric, nobody else except browser can decrypt the data even if a third party has public key of browser.

The idea of RSA is based on the fact that it is difficult to factorize a large integer. The public key consists of two numbers where one number is multiplication of two large prime numbers. And private key is also derived from the same two prime numbers. So if somebody can factorize the large number, the private key is compromised. Therefore encryption strength totally lies on the key size and if we double or triple the key size, the strength of encryption increases exponentially. RSA keys can be typically 1024 or 2048 bits long, but experts believe that 1024 bit keys could be broken in the near future. But till now it seems to be an infeasible task.

Let us learn the mechanism behind RSA algorithm :

  • >> Generating Public Key :
     
    • Select two prime no's. Suppose P = 53 and Q = 59. Now First part of the Public key : n = P*Q = 3127.
    • We also need a small exponent say e : But e Must be
      • An integer.
      • Not be a factor of n.
      • 1 < e < Φ(n) [Φ(n) is discussed below], Let us now consider it to be equal to 3.
    • Our Public Key is made of n and e
  • >> Generating Private Key :

     
    • We need to calculate Φ(n) : Such that Φ(n) = (P-1)(Q-1) so, Φ(n) = 3016
    • Now calculate Private Key, d : d = (k*Φ(n) + 1) / e for some integer k For k = 2, value of d is 2011.

Now we are ready with our – Public Key ( n = 3127 and e = 3) and Private Key(d = 2011)

Now we will encrypt “HI” :

 
  • Convert letters to numbers : H = 8 and I = 9
  • Thus Encrypted Data c = 89e mod n. Thus our Encrypted Data comes out to be 1394
  • Now we will decrypt 1394 :
  • Decrypted Data = cd mod n. Thus our Encrypted Data comes out to be 89
  • 8 = H and I = 9 i.e. "HI".

Below is C implementation of RSA algorithm for small values:

// C program for RSA asymmetric cryptographic

// algorithm. For demonstration values are

// relatively small compared to practical

// application

#include<stdio.h>

#include<math.h>

// Returns gcd of a and b

int gcd(int a, int h)

{

    int temp;

    while (1)

    {

        temp = a%h;

        if (temp == 0)

          return h;

        a = h;

        h = temp;

    }

}

// Code to demonstrate RSA algorithm

int main()

{

    // Two random prime numbers

    double p = 3;

    double q = 7;

    // First part of public key:

    double n = p*q;

    // Finding other part of public key.

    // e stands for encrypt

    double e = 2;

    double phi = (p-1)*(q-1);

    while (e < phi)

    {

        // e must be co-prime to phi and

        // smaller than phi.

        if (gcd(e, phi)==1)

            break;

        else

            e++;

    }

    // Private key (d stands for decrypt)

    // choosing d such that it satisfies

    // d*e = 1 + k * totient

    int k = 2; // A constant value

    double d = (1 + (k*phi))/e;

    // Message to be encrypted

    double msg = 20;

    printf("Message data = %lf", msg);

    // Encryption c = (msg ^ e) % n

    double c = pow(msg, e);

    c = fmod(c, n);

    printf("\nEncrypted data = %lf", c);

    // Decryption m = (c ^ d) % n

    double m = pow(c, d);

    m = fmod(m, n);

    printf("\nOriginal Message Sent = %lf", m);

    return 0;

}

// This code is contributed by Akash Sharan.

Output :

Message data = 12.000000
Encrypted data = 3.000000
Original Message Sent = 12.000000

RSA laid the foundations for much of our secure communications. It was traditionally used in TLS and was also the original algorithm used in PGP encryption. RSA is still seen in a range of web browsers, email, VPNs, chat and other communication channels.

Note: Plzzz don' t give dislike.....Plzzz comment if u have any problem i will try to resolve it.......


Related Solutions

1. What is meant by malware/viruses? What is their history? Are malware and/or viruses recent developments...
1. What is meant by malware/viruses? What is their history? Are malware and/or viruses recent developments in computer technology or have they been around for a while? What piece of malware/virus are choosing to write about and why?  
The Vigenère Cipher is an encryption algorithm that combines the use of a keyword with the...
The Vigenère Cipher is an encryption algorithm that combines the use of a keyword with the message to be encrypted. A tableau is provided that shows an encrypted character for each combination of characters in the message and the keyword. Using the Vigenère Tableau encryption scheme with a keyword of KEYWORD, encrypt the following message: IS INFORMATION SECURITY ESSENTIAL After encrypting the message, decrypt the following message, using KEYWORD as the keyword: YRJUW WWRIG JTFUW ERECE LCMKL CIWKR R For...
Finish the following java question:  Modify a Encryption program so that it uses the following encryption algorithm:...
Finish the following java question:  Modify a Encryption program so that it uses the following encryption algorithm: Every letter (both uppercase and lowercase) converted to its successor except z and Z, which are converted to 'a' and 'A' respectively (i.e., a to b, b to c, …, y to z, z to a, A to B, B to C, …, Y to Z, Z to A) Every digit converted to its predecessor except 0, which is converted to 9 (i.e., 9...
Modify the Encryption program so that it uses the following encryption algorithm: Every letter (both uppercase...
Modify the Encryption program so that it uses the following encryption algorithm: Every letter (both uppercase and lowercase) converted to its successor except z and Z, which are converted to 'a' and 'A' respectively (i.e., a to b, b to c, …, y to z, z to a, A to B, B to C, …, Y to Z, Z to A) Every digit converted to its predecessor except 0, which is converted to 9 (i.e., 9 to 8, 8 to...
1. Explain Malware and viruses ? 2. Explain two of the attacks and give a real...
1. Explain Malware and viruses ? 2. Explain two of the attacks and give a real scenario ? 3. How can you defend your network from these attacks?
The prompt is using Python:  Write a 3 rail transposition encryption algorithm, and a corresponding decryption algorithm....
The prompt is using Python:  Write a 3 rail transposition encryption algorithm, and a corresponding decryption algorithm. Implement these two algorithms in their own function. Now write a testing function that demonstrates your algorithms work for all interesting cases!
The mathematical expression of the encryption and decryption process of a Caesar cipher algorithm is expressed...
The mathematical expression of the encryption and decryption process of a Caesar cipher algorithm is expressed respectively as: c=Ep, k=p+k%26                                                                                                                         (1) p=Dc,k=c-k%26                                                                                                                         (2) Please do the following: Write at least two paragraphs to explain the principle of operation of the algorithm. For a full credit, your explanation must show the architectural diagram of the encryption and decryption process. Write a program to implement the Caesar algorithm Code must have two functions; encryption and decryption Test your codes with p as...
1. What are the various types of malware? 2. How do worms differ from viruses? 3....
1. What are the various types of malware? 2. How do worms differ from viruses? 3. Do Trojan horses carry viruses or worms?
Now let’s look at a more modern symmetric encryption. Assume that the algorithm for this system...
Now let’s look at a more modern symmetric encryption. Assume that the algorithm for this system is to rotate the bits in the message right 4 positions, XOR the bits with the key, and rotate the bits 2 positions to the left. a.What is the key? (The Key is 5A) b. Using the key and the above algorithm, decrypt the following message which contains a name (given in hex): BD 7D FA BC 78 3C 3D. Remember that you’ll have...
Now let’s look at a more modern symmetric encryption. Assume that the algorithm for this system...
Now let’s look at a more modern symmetric encryption. Assume that the algorithm for this system is to rotate the bits in the message right 4 positions, XOR the bits with the key, and rotate the bits 2 positions to the left. a. The key is 5A b. Using the key and the above algorithm, decrypt the following message which contains a name (given in hex): BD 7D FA BC 78 3C 3D. Remember that you’ll have to reverse the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT