首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写SCC.363、代做Java,c++设计程序
项目预算:
开发周期:
发布时间:
要求地区:
2023-2024 ASSESSMENTS
Undergraduate
Individual Programming
Assessment Weighting [30%]
SCC.363 Security and Risk
Academic Honesty and Integrity
Students at Lancaster University are part of an academic community that values trust,
fairness and respect and actively encourages students to act with honesty and integrity. It is
a University policy that students take responsibility for their work and comply with the
university’s standards and requirements- found in the Manual of Academic Regulations and
Practice. By submitting their answers students will be confirming that the work submitted is
completely their own. By submitting their answers the group of students will be confirming
that the work submitted is that of the group. Academic misconduct regulations are in place
for all forms of assessment and students may familiarise themselves with this via the
university website:
https://www.lancaster.ac.uk/academic-standards-and-quality/regulations-policies-andcommittees/manual-of-academic-regulations-and-procedures/
Plagiarism
Plagiarism involves the unacknowledged use of someone else’s work and passing it off as if it
were one’s own. This covers every form of submitted work, from written essays, video
vignettes, and coding exercises. However, deliberately plagiarism with the intent to deceive
and gain academic benefit is unacceptable. This is a conscious, pre-meditated form of
cheating and is regarded as a serious breach of the core values of the University. More
information may be found via the plagiarism framework website. All coursework is to be
submitted electronically and will be run through our plagiarism detection mechanisms.
Please ensure you are familiar with the University's Plagiarism rules and if you are in any
doubt please contact your module tutor.
https://www.lancaster.ac.uk/academic-standards-and-quality/regulations-policies-andcommittees/principles-policies-and-guidelines/plagiarism-framework/
General Guidance:
This is an individual assessment that will count for 30% of your overall mark for this module.
Learning objectives
• Develop appreciation and understanding of security concepts.
• Formulate troubleshooting methods to identify/solve problems.
• Evaluate information to argue solution choices critically.
• Effectively communicate ideas.
Submission requirements
Prepare and submit your coding solutions on Coderunner. For all coding solutions, you must
use Python3. You can use modules from standard Python3 and cryptography.io. Your code
should include appropriate comments explaining what you do and why. All implementations
must be in Python3, and the cryptography.io library must be used for any cryptographyrelated functions (if needed). If you must consider padding in any task, you should use PKCS7.
Your code should include appropriate comments explaining your solution.
Example of the type of comments you SHOULD AVOID -- the comments don't explain the
solution:
def avalancheCalculator(string1, string2):
# I hash the strings and generate the hexdigest values
hexstring1 = hashlib.sha256(string1.encode()).hexdigest()
hexstring2 = hashlib.sha256(string2.encode()).hexdigest()
# I convert the hexdigest to integers
int1 = int(hexstring1, 16)
int2 = int(hexstring2, 16)
# I XOR the integers
intResult = int1 ^ int2
# I return the 1's in the binary representation.
return ( bin(intResult).count('1') )
Examples of types of comments that provide adequate information – the comments explain
the solution to the problem:
def avalancheCalculator(string1, string2):
# A solution to the problem is to xor the integer representation
# of the two values and count in the resulting int the number of bits
# having the value of 1.
hexstring1 = hashlib.sha256(string1.encode()).hexdigest()
hexstring2 = hashlib.sha256(string2.encode()).hexdigest()
int1 = int(hexstring1, 16)
int2 = int(hexstring2, 16)
intResult = int1 ^ int2
# The "1"s in the binary representation of the XOR operation
# represent which bits from int1 and int2 are different.
# This is due to applying the XOR operation. 0^1 = 1, 1^0 = 1
# Counting the "1"s will provide how many bits differ
return ( bin(intResult).count('1') )
You have to upload the implementation of your functions on CodeRunner.
Marking Guidelines:
• You have to answer all three (3) tasks. Marks will be allocated based on the clarity of your
solution, comments in the code, and correctness. More information is provided within the
individual questions.
• The name of functions, type/number of variables, and return values must follow the tasks’
guidelines. Failing to adhere to this may result in not receiving marks.
Deadline for submissions: Friday 16
th February 16:00
TASK 1
--------
You are provided with the ds_hash hash function. The function receives a
finite message as input and produces a non-negative integer, which we
consider to be the hash value of the given message.
The size of input messages is fixed and always equals 64 bytes. Implement an
appropriate attack to check if the hash function ds_hash is strong collision
resistant. Your alphabet should include all lower-case and upper-case letters
of the English alphabet and all numbers from 0 to 9.
# -- START OF YOUR CODERUNNER SUBMISSION CODE
# INCLUDE ALL YOUR IMPORTS HERE
def ds_hash(message: str) -> int:
hash_value = 0
for ch in message:
hash_value = (hash_value * 71) + ord(ch)
return hash_value & 0x7FFFFFFF
def myAttack() -> bool:
# YOUR IMPLEMENTATION
return # True or False
# -- END OF YOUR CODERUNNER SUBMISSION CODE
#You can test your code in your system (NOT IN YOUR CODERUNNER SUBMISSION)
as follows:
# MAIN
if __name__ == "__main__":
print( myAttack() )
Marking scheme: This task's weight is 35% for providing a valid attack and
commenting on your code.
TASK 2
--------
Implement an HMAC based on the RFC-2104 definition (Section 2). The RFC is
available at the following link: https://www.rfc-editor.org/rfc/rfc2104
Below is the extract from the RFC that describes how the HMAC can be
implemented, and this is what you need to implement. The text is amended to
provide specific information about the selected H cryptographic hash
function, i.e., SHA256.
The definition of HMAC requires a cryptographic hash function, which
we denote by H, and a secret key K. In your implementation, assume H
to be the SHA256 cryptographic hash function.
We denote by B the byte-length of such blocks (B=64 for SHA256),
and by L the byte-length of hash outputs (L=32 for SHA256).
The authentication key K can be of any length up to B, the
block length of the hash function. Applications that use keys longer
than B bytes will first hash the key using H and then use the
resultant L byte string as the actual key to HMAC. In any case the
minimal recommended length for K is L bytes (as the hash output
length).
We define two fixed and different strings ipad and opad as follows
(the 'i' and 'o' are mnemonics for inner and outer):
ipad = the byte 0x36 repeated B times
opad = the byte 0x5C repeated B times.
To compute HMAC over the data `text' we perform
H(K XOR opad, H(K XOR ipad, text))
Namely,
(1) append zeros to the end of K to create a B byte string
(e.g., if K is of length 20 bytes and B=64, then K will be
appended with 44 zero bytes 0x00)
(2) XOR (bitwise exclusive-OR) the B byte string computed in step
(1) with ipad
(3) append the stream of data 'text' to the B byte string resulting
from step (2)
(4) apply H to the stream generated in step (3)
(5) XOR (bitwise exclusive-OR) the B byte string computed in
step (1) with opad
(6) append the H result from step (4) to the B byte string
resulting from step (5)
(7) apply H to the stream generated in step (6) and output
the result
The function's name has to be CustomHMAC and defined as follows.
# -- START OF YOUR CODERUNNER SUBMISSION CODE
# INCLUDE ALL YOUR IMPORTS HERE
def CustomHMAC(key: bytes, text: str) -> str:
# YOUR IMPLEMENTATION
return # YOUR RESULT
# -- END OF YOUR CODERUNNER SUBMISSION CODE
#You can test your code in your system (NOT IN YOUR CODERUNNER SUBMISSION)
as follows:
# MAIN
if __name__ == "__main__":
k = os.urandom(16) # k is
txt = "hello world!!!!" # txt is
print( CustomHMAC(k, txt) )
# The output will be a string of hexadecimal values, e.g.: a51b … 35fa
You can debug your code against the result from the following function:
from cryptography.hazmat.primitives import hashes, hmac
def HMAC_from_Cryptography(key: bytes, text: str) -> str:
h = hmac.HMAC(key, hashes.SHA256())
h.update(text.encode())
signature = h.finalize().hex()
return signature
Marking scheme: This task's weight is 40%, which will be allocated equally
for correctly implementing the steps and commenting on your code.
TASK 3
--------
Using the AES-ECB encryptor from the cryptography.io module, implement the
AES mode in Figure 1. You can instantiate an AES-ECB encryptor as follows:
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms,
modes
key = # SELECT AN APPROPRIATE KEY FOR AES
cipher = Cipher(algorithms.AES(key), modes.ECB())
encryptor = cipher.encryptor()
Figure 1 - The figure describes a mode of AES for encrypting plaintext to ciphertext
The function's name has to be CustomAESmode and defined as follows:
# -- START OF YOUR CODERUNNER SUBMISSION CODE
# INCLUDE ALL YOUR IMPORTS HERE
def CustomAESMode(key: bytes, iv: bytes, plaintext: str) -> str:
# YOUR IMPLEMENTATION
return # THE CIPHERTEXT
# -- END OF YOUR CODERUNNER SUBMISSION CODE
#You can test your code in your system (NOT IN YOUR CODERUNNER SUBMISSION)
as follows:
# MAIN
if __name__ == "__main__":
key = bytes.fromhex("06a9214036b8a15b512e03d534120006")
iv = bytes.fromhex("3dafba429d9eb430b422da802c9fac41")
txt = "This is a text"
print( CustomAESMode(key, iv, txt) )
# The result using the above input should be:
1827bfc04f1a455eb101b943c44afc1d
Marking scheme: This task's weight is 25%, which will be allocated equally
for correctly implementing the steps and commenting on your code.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!