代写代考 COMP1521 students are able to complete this subset.

• Introduction
• Getting Started
• Reference Implementation
• Your Tasks

Copyright By PowCoder代写 加微信 powcoder

• Subset 0: File and directory commands
• Subset 1: XOR encryption
• Subset 2: Directory traversal
• Subset 3: ECB encryption
• Subset 4: Cyclic block shift encryption
• Assumptions and Clarifications
• Assessment
© Submission
o Due Date
© Assessment Scheme
o Intermediate Versions of Work
• Assignment Conditions
Change Log

to improve your understanding of filesystem objects
to give you experience writing C code to manipulate binary files
• to further experience practical uses of bitwise operations
• to give you experience writing a relevant low-level data manipulation program in C
Introduction
Your task in this assignment is to write bytelocker, a rudimentary single-file encryption tool. Throughout this assignment, you
will explore some basic filesystem operations, as well as implement several rudimentary encryption algorithms.
Encryption is the process of converting information into an obscured format, which can (in theory), only be converted back into
useful information by an authorized party who knows the encryption process and key. Encryption is an incredibly useful tool,
and is the reason why the internet can function in the way it does, with sensitive information freely transmitted across it.
File encryption is particularly useful to safeguard data in the case that it is stolen. Encrypting your files could prevent someone
from being able to access your photos in the event that your laptop gets stolen.
In this assignment, you will implement three different algorithms for file encryption: XOR (eXclusive OR), ECB (Electronic Code
Book) and CBC (Cyclic Block Cipher). Each of these algorithms function slightly differently, but all work towards the same
purpose of obscuring information, that can only be correctly interpreted by an authorised party.
XOR encryption works by employing the bitwise XOR operation on every bit of some given data. A key, which when broken up
into it’s constituent bits, expanded to much the length of the data being encrypted. The XOR operation is then employed
between these two bitstreams to yield the encrypted data. This encrypted data can be decrypted only by re-running the same
XOR operation with the same key. In bytelocker, standalone XOR encryption will only employ the the single-byte key exFF.
ECB encryption works by bit-shifting data by the amount specified by some key (a password). Each character in a ‘block’ of the
input data is shifted by the value of the character in the corresponding position within the password. The encrypted data can be
decrypted only by shifting it back by the value of the corresponding position within the password. In bytelocker, passwords will
be a fixed length of 16 characters.
CBC encryption is different to the above two algorithms as each block of the encrypted data contributes to the encryption of
the next block. We will combine both XOR encryption, and ECB encryption to develop an encryption algorithm where it is
significantly harder for an unauthorised party to read our encrypted data by guessing our password
However, before all of this, bytelocker needs to be able to function as a basic standalone program. As such, we will implement
several filesystem manipulation operations. You will also implement two different methods of searching for files, which will make
the user’s life easier in finding what they might need to encrypt.

Subset O: File and directory commands
RATIONALE:
Why does this subset exist? This subset tests your ability to interact with low-level C library calls and system
calls to interact with file system objects, and to give you a better idea of detecting and handling errors with
these calls.
Who do we expect to complete this subset? We hope that all students will be able to complete this subset.
What help will tutors provide to students? Tutors can give you a theoretical explanation, and give lots of
help with the lab exercises that lead to this assignment. Tutors will be happy to help you debug any issues with
your code.
How many marks will I get? Completing this subset, with good style, is worth around 50% of the
performance component of this assignment.
For this subset, you will need to implement the following four functions:
show_perms (char filename[MAX_PATH_LEN])
print_current_directory()
change_directory(char dest_directory[MAX_PATH_LEN])
list current directory()
All user input is handled for you in main.c. You will not have to read input from stdin – all inputs are passed in through
arguments to these functions for you.

Subset 1: XOR encryption
RATIONALE:
Why does this subset exist? We hope to provide you with an opportunity to experience a practical application
of bitwise operations, and test your ability to implement some input/output operations.
Who do we expect to complete this subset? Though it may be more difficult for some, we hope that all
students will be able to complete this subset.
What help will tutors provide to students? Tutors can give you a theoretical explanation, and give lots of
help with the lab exercises that lead to this assignment. Tutors will be happy to help you debug any issues with
your code if you can demonstrate your issue and explain what you have already tried to solve your problem.
How many marks will I get? Completing this subset, with good style, is worth around 15% of the
performance component of this assignment.
For this subset, you will need to add code to implement the following three functions:
test_can_encrypt(char filename[MAX_PATH_LEN])
simple_xor_encryption(char filename[MAX_PATH_LEN])
simple_xor _decryption(char filename[MAX_PATH_LEN])
to check if a file can be encrypted, and implement XOR encryption.

Subset 2: Directory Traversal
RATIONALE:
Why does this subset exist? This subset further tests your ability to interact with filesystem objects, and
making decisions based on the contents of these objects.
Who do we expect to complete this subset? While again more difficult than previous subsets, we are hoping
that at least half of COMP1521 students are able to complete this subset.
What help will tutors provide to students? Tutors can give you a theoretical explanation, and give lots of
help with the lab exercises that lead to this assignment. Tutors will be happy to help you debug issues with
code if you, can explain what you’ve already tried to solve your problem, though they may prioritize help with
earlier subsets over giving help to people in Subset 2.
How many marks will I get? Completing this subset, with good style, is worth around 15% of the
performance component of this assignment.
For this subset, you will need to implement the following two functions:
search_by_filename(char filename[MAX_SEARCH_LENGTH])
search_by_text (char text[MAX_SEARCH_LENGTH])
bytelocker provides two ways to search for a file: by name and content
For both these cases, it is expected that you traverse the entire directory tree of your current working directory, including
any subdirectories, subdirectories of subdirectories and so on. Searching by name should output results in alphabetical
order, whereas searching by content should be ordered by number of matches, and then alphabetical order. The
sort by_name and sort_by_count should help you implement these behaviours.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com