Computer Science 2
Computer Science 2
Duplicate files
are files that are exactly the same (bit for bit identical). Space is often wasted on computers by having multiple
versions of the same file. Duplicate file finders are programs that find and identify duplicate files on a hard drive
so that they can be removed.
Every time the program encounters a file it takes a hash of the file and checks it against a list. If the hash exists
in the list, the file is marked to be deleted. If the hash does not exist it is added to the list.
(i) Explain two characteristics you would look for in a hashing algorithm for this purpose.
[4]
(ii) After running the program a user finds that they still have apparent duplicates of some of their images.
Explain why these apparent duplicates might still be present.
[2]
[5]
Show the effect of applying XOR on Text and Key, by completing the last row of the table below.
[2]
[2]
(c) Explain whether the type of encryption described above is symmetric or asymmetric.
[2]
(d) Explain why asymmetric encryption is more suited to transactions over the internet than symmetric encryption.
[4]
The organisation decides to make a copy of Shakespeare’s entire works available as a downloadable text file
from its website. It further decides to compress the file before making it available to download.
(i) State an advantage to the website’s visitors of the file being compressed.
[1]
(ii) Explain why the company should use lossless and not lossy compression.
[3]
The organisation looks at using either run length encoding or dictionary encoding to compress the file
described in part (a).
Discuss the two compression methods and justify which you would recommend. You may refer to the extract of
text below to illustrate your argument.
The forum stores details of its users in the table called Users. An extract of Users is shown below.
1 Zeus 8dfa46a79248037752bba6166fcb34f8 1
2 Hera 74d39d60507eb55e000c6ec5c1265891 0
3 Poseidon b015d770d0208ddcce2c2c719fe29371 0
Describe what is meant by the term ‘primary key’, giving an example from the table above.
[2]
[1]
[2]
[3]
(d)
Sometimes users can have their accounts locked if they behave inappropriately. When this is the case the
locked field is set to 1 rather than 0.
Write an SQL statement that locks the account of the user Hades
[3]
passwordHash and locked have already been extracted from the database before being passed to the
function. It should return the value true if a user should be allowed access to a system and false if they aren’t.
Your function should make use of the pre-written function hash() which takes in a string and returns the hash
of that string.
e.g.
6 * Modern encryption is much stronger than the method described in the first part of this question.
Discuss the impact of modern encryption on society. You should refer to:
• The importance of asymmetric encryption and how it differs from symmetric encryption.
• Different circumstances in which symmetric and asymmetric encryption may be used.
For each vehicle that passes by, a letter is entered into the system.
[1]
The following sequence has been compressed using Run Length Encoding.
3C3M4C
[2]
CCCCOLLLCCCCCMOCCCCC
[3]
8 Shreya is a web developer who creates webpages for a variety of different companies.
(i) State which method of compression is most likely to be used for this purpose.
[1]
[2]
1 i Low chance of collision (i.e. different 4 1 mark for each correct identification
inputs giving same output) (1 – AO1.2) (AO1.2) up to a maximum of two
to reduce risk of different files being identifications
marked as the same (1 – AO2.1).
Quick to calculate (1 – AO1.2) as lots 1 mark for each valid explanation (AO2.1)
of files need to be hashed / needs to up to a maximum of two explanations.
be quicker than a bitwise comparison
to make it worthwhile (1 – AO2.1). No credit for function being one way as this
Provides a smaller output than input (1 serves no benefit in this scenario.
– AO1.2) so quicker to compare
hashes than original data (1 – AO2.1).
ii Hashing works on the data / bits (1) 2 Up to 2 marks for a valid explanation.
and so two images may appear the
same but not be identical at a bit level Accept any other sensible examples of
(1). This could be because they are changes to images that might not be
different file types (1) / different sizes immediately apparent to someone viewing
(1). Even the change of a single bit the image.
may result in a completely different
hash (1).
Total 6
Total 5
3 a 2
One byte correct (1) all three bytes
correct. (1)
c Symmetric (1) …. as the same key is used 2 Allow FT for asymmetric if (b) indicates
to decrypt it as encrypt it (1) asymmetric encryption used
Total 10
Examiner’s Comments
This question was well received by most
(Max 1) candidates, invariably scoring most marks.
b Mark Band 3–High Level (9–12 marks) AO1.1 Points may include but aren’t limited to:
Examiner’s Comments
Candidates were assessed on the quality
of their extended response in this question.
Most candidates could describe each of
the given types of compression
appropriately, with many applying them to
the scenario. Many candidates correctly
concluded that dictionary encoding was the
most appropriate in this case, but few then
went on to give clear and appropriate
justification for their assertion. In general,
most candidates scored well on this
question.
Total 16
Examiner’s Comments
Well received and answered by most
candidates.
c SELECT passwordHash, locked (1) 3 Do not award first mark for SELECT *
FROM Users (1)
WHERE username=‘Apollo’ (1) (AO 3.2)
Examiner’s Comments
In most cases, candidates who achieved
marks in c) went on to achieve marks in d)
with few candidates achieving all marks in
either. Many candidates did not use correct
SQL statement structure or syntax e.g.
confusing attribute names with string
literals.
Examiner’s Comments
In most cases, candidates who achieved
marks in c) went on to achieve marks in d)
with few candidates achieving all marks in
either. Many candidates did not use correct
SQL statement structure or syntax e.g.
confusing attribute names with string
literals.
Total 15
Mark Band 1-Low Level (1-3 marks) are used equally well. Few discussed the
The candidate demonstrates a basic impact on society. Many candidates scored
knowledge modern encryption and the in the mid band on this question.
difference between symmetric and
asymmetric encryption; the material is
basic and contains some inaccuracies. The
candidate makes a limited attempt to apply
acquired knowledge and understanding to
the context provided.
0 marks
No attempt to answer the question or
response is not worthy of credit
Total 9
AO1.2
– CCC
– … followed by MMMCCCC
(1 per -, max 2)
Total 6
8 i Lossy 1
AO2.1
(1)
Total 3