CP70045E M.Sc. Fundamentals of Cybersecurity Assignment 1 Brief |UWL

Published: 29 Mar, 2025
Category Assignment Subject Computer Science
University University of West London Module Title CP70045E M.Sc. Fundamentals of Cybersecurity

Question 1: Implementing RSA Key Generation Algorithm (20 pts)

Context: Read Task 1 from the RSA Lab document.

Follow the instructions provided to generate an RSA key pair. The bn_sample.c program demonstrates how to use OpenSSL's BIGNUM operations for mathematical computations. Using these OpenSSL functions, write a C program that fully implements RSA key generation.

Required:

A.   Background (Max word count 300): Summarize the background of RSA encryption, including

  • its fundamental principles and why it is widely used
  • the role of prime numbers in key generation.
  • the importance of modular exponentiation in encryption and decryption.

B. Write a C program named task1.c that performs the following:

  •  Generates two random 256-bit prime numbers (p, q).
  • Computes the RSA modulus: N=p×q
  • Computes Euler’s Totient Function: ϕ(N)=(p−1)×(q−1)
  • Sets a public exponent (e = 65537).
  • Computes the private exponent (d): d=e−1mod ϕ(N)
  • Prints the values for:

o    Generated primes (p, q)
o    Modulus (N)
o    Euler’s Totient (ϕ(N))
o    Public exponent (e)
o    Private exponent (d)
o    Private exponent (d)

  • Reveal keys: Write down your public key (e, N) and private key (d, N).
  • Write the keys to keys.txt: Write down your keys to a file named keys.txt. This file content would be read I the subsequent questions.

The output should be in this format

CP70045E M.Sc. Fundamentals of Cybersecurity

Question 2: Encrypting and Decrypting Your Group Name (20 pts)

Context:

In Question 1, you generated an RSA key pair (N, e, d). Now, in Task 2, you will use the generated key values to first encrypt and then decrypt your “Group Name”

Required:
A.   Find a unique group name for yourself, such as group_1, group_2, etc.
B. Write a C program named task2.c that takes plain text input, your group name, performs the following steps:

Step 1: Read public key from keys.txt file Read RSA Modulus (N) in hex format.

Read Public Exponent (e) in hex format. Read Private Exponent (d) in hex format.

Step 2: Convert Message to a BIGNUM

Convert the ASCII input message into a hexadecimal string. Convert the hex string into a BIGNUM.

Step 3: Encrypt the Message

Compute the ciphertext (C) using the RSA encryption formula: C=Me mod N
Print the ciphertext in hexadecimal format.

Step 4: Decrypt the Ciphertext

Compute the decrypted message (M) using the RSA decryption formula: M=Cd mod N
Print the decrypted message in hexadecimal format.

Step 5: Convert Decrypted Hex Back to ASCII

Convert the hexadecimal decrypted message back to ASCII.
Print the final decrypted message and verify that it matches the original input.

Deliverables:

  • task2_c,
  • screenshot of executing the task2_c.

The output should look like below

CP70045E M.Sc. Fundamentals of Cybersecurity

Buy Answer of This Assignment & Raise Your Grades

Order Non Plagiarized Assignment

Question 3: Implement RSA Digital Signing using OpenSSL (20 pts)

Context: In Q2 (previous task), you implemented RSA encryption and decryption. Now, in Q3, you will extend RSA to digital signatures, using the same key pair (e, d, N) from Q1.

Required:

Write a C program named task3.c that takes a message (Your message would be “I owe group_name $2000”) to sign and performs the following steps:

Step 1: Read Inputs
a. Read RSA Modulus (N) in hex format.
b. Read Private Exponent (d) in hex format.

Step 2: Convert the Message to a BIGNUM

  • Convert ASCII input message (M) into hex format.
  • Convert the hex string into a BIGNUM (M_bn).

Step 3: Generate the RSA Signature

  • The digital signature (S) is created using: S=Mdmod N
  • Print the signature (S) in hex format.

Step 4: Modify the Message and Sign Again

  • Change "I owe group_name $2000." → "I owe group_name $3000."
  • Sign the new message and compare both signatures. The resulting screenshot should look like below.

The resulting screenshot should look like below.

CP70045E M.Sc. Fundamentals of Cybersecurity

Q4: Implement RSA Signature Verification using OpenSSL (15 pts)

Context: In Q3, you implemented RSA signing using the private key (d, N).
Now, in Q4, you will implement RSA signature verification using the public key (e, N). This ensures that the message came from a valid signer and was not modified.

Required:

Develop task4.c (Signature Verification Program) which does the following.

Step 1: Read Inputs

  • Prompt the user for the RSA Modulus (N) in hex format.
  • Prompt the user for the Public Exponent (e) in hex format.
  • Prompt the user for the Signature (S) in hex format.
  • Prompt the user for the Original Message (M).

Step 2: Verify the Signature

  • Compute: M′=Semod NM' = S^e \mod NM′=SemodN
  •  Convert M' back to ASCII and check if it matches the original message (M).
  • If M' is different, the signature is invalid.

Step 3: Modify the Signature and Re-Verify

  • Change one byte in S to simulate corruption.
  • Repeat the verification and describe what happens.

Deliverables:

  • task4.c
  • Screenshot for the execution of the c file

The output should look like below.

CP70045E M.Sc. Fundamentals of Cybersecurity

Question 5: Frequency Analysis (20 pts) Context:

In this question you will analyze an encrypted message without knowing the encryption algorithm used. You will be provided with the following files:

  • task5_1.c,
  • task5_2.c, ciphertext.txt, and mappings.txt
  • task5_1.c: This program performs frequency analysis on the encrypted text. It counts the occurrences of each letter and sorts them in descending order to help infer letter mappings.
  • task5_2.c: This program applies the determined letter mappings to decrypt the text. It takes a mapping file as input and replaces each letter in the ciphertext accordingly.
  • mappings.txt file is empty initially ( I will only provide sample row to show the format). It should have two columns each column containing a letter.
  • ciphertext.txt: This file containsthe encrypted text.

Required:

A. Decrypt the Ciphertext:

In this part you will create the content for the mappings.txt file. For that first run task5_1.c to perform frequency analysis on ciphertext.txt. This will generate frequency statistics for each letter, helping to determine the most probable letter mappings. Create mappings.txt based on the frequency analysis output. Compare the letter frequencies with typical English letter frequencies to infer the correct substitutions.

When you have the mappings.txt ready. run task5_2.c to decrypt the message using the mappings from mappings.txt. This will output the decrypted text. You can adjust mapping.txt file until you are happy with the result.

B.  Reflection and Analysis (Max 250 words)

  • Where did you encounter difficulties during the analysis?
  •  If the ciphertext were longer or shorter, would the decryption process be easier or more challenging?
  • What strategies helped you determine the correct mappings?

CP70045E M.Sc. Fundamentals of Cybersecurity

Buy Non Plagiarized & Properly Structured Assignment Solution

Order Non-Plagiarized Assignment

Are you worried about the CP70045E M.Sc. Fundamentals of Cybersecurity Assignment 01? There's no need to worry! If you need help on assignments, we are here to assist you We also provide free assignment samples of high-quality, original content written by our PhD expert writers, so you can get an idea of ​​the quality. Our focus is to provide you with computer science assignment help in the UK, that too before the deadline! Now stop worrying about late submissions and contact us for the best grades. Hand over your assignment worries to our experts today!

Workingment Unique Features

Hire Assignment Helper Today!


Latest Free Samples for University Students

RBP020L063H Leadership and Change Management Assignment Sample

Category: Assignment

Subject: Management

University: University of Roehampton

Module Title: RBP020L063H Leadership and Change Management

View Free Samples

HRMM080 Ethical and Responsible Leadership AS2 Reflective Portfolio Sample

Category: Assignment

Subject: Management

University: University of Northampton

Module Title: HRMM080 Ethical and Responsible Leadership

View Free Samples

ACAD1346 The child’s live Experience Developing Confidence Learners Assignment Sample

Category: Assignment

Subject: Education

University: University of Greenwich (UOG)

Module Title: ACAD1346 The child’s live Experience Developing Confidence Learners

View Free Samples

NUR7011 Developing Healthcare Leaders Assignment Sample | BPP

Category: Assignment

Subject: Nursing

University: BPP University

Module Title: NUR7011 Developing Healthcare Leaders

View Free Samples

Project Management, Leadership and Skills: Planning & Control Portfolio Example

Category: Assignment

Subject: Management

University: University of Salford Manchester

Module Title: Project Management, Leadership and Skills: Planning & Control

View Free Samples
Online Assignment Help in UK