美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇

COMP 3334代做、代寫Python語言編程

時間:2024-03-20  來源:  作者: 我要糾錯



COMP 3334 – Computer Systems Security (Semester 2, 2024)
Assignment
This is an individual assignment. You may use the course material and Internet resources to answer
the questions. However, you should not post the questions online and ask for help. Discussion
among your peers is encouraged; however, you must produce answers by yourself and in your own
words. Any suspicion of plagiarism will be thoroughly investigated. Copying answers from GenAI
tools into your assignment is a form of plagiarism. This assignment is due on Sunday, 17 March
2024, 23:59.
Late submissions will be subjected to a 15% penalty per day, starting at 00:01.
Total: 100 points. Course weight: 10%.
Submission requirements
Submit on Blackboard a single ZIP file containing:
1. A PDF file named as comp3334-studentid.pdf for your written answers. Change “studentid” with
your actual student ID. The file must also include your name and student ID on the first page.
2. The three Python files as requested in the exercises below: exercise{1,3,4}.py.
Double check your submission. Any incorrect submission format may result in a zero mark for this
assignment.
Exercise 1: Misusing AES [30 pts]
A website authenticates its users by asking for a login/password, and sends them a cookie C, valid
for one minute, to keep track of their authentication status. The cookie C is formed such as C =
Enc("user=username,tmstmp=timestamp"), with username = "anonymous" for unauthenticated users,
or the name of the user when authenticated; and timestamp is a Unix-formated timestamp1
representing
the time up to which the user is authenticated (current time plus one minute). Enc(·) designates the
AES256 encryption in OFB-mode using iv as a random IV and k as a random key; both k and iv are
unknown to us. The OFB mode of operation for encryption is described in Figure 1.
In this exercise, we consider cookies delivered on February 1st, 2024 at 00:00am UTC. At that time,
an unauthenticated user coming to the website will receive a cookie:
CU = AES256-OFBk,iv("user=anonymous,tmstmp=1706745660")
The value 1706745660 corresponds to 00:01am on February 1st. We denote by PU the plaintext version
of the cookie.
a) Give the plaintext cookie, denoted PA, that corresponds to the authenticated admin user if he
logged in at the same time. Compare the length of PA and PU . [3 pts]
b) Describe how to modify the cookie CU into CA = AES256-OFBk,iv(PA) without knowing k nor
iv. You may rethink about the value of PA so that PU and PA have the same length. Note that
the cookie may authenticate the user admin for as long as you want (but at least the original one
minute duration). [7 pts]
c) Implement in Python the attack that would turn CU into a valid CA for at least the original duration.
Prepare a single Python file named exercise1.py that contains a function modifycookie() that
takes as argument a base64-encoded cookie and returns the base64-encoded modified cookie. Your
attack should work for different timestamps. You will get full marks if, given an encrypted cookie
1https://www.epochconverter.com/
1
block cipher
encryption Key
Ciphertext
Initialization Vector (IV)
block cipher
encryption Key
Ciphertext
block cipher
encryption Key
Ciphertext
Plaintext Plaintext Plaintext
Figure 1: Output Feedback (OFB) mode of operation (during encryption)
issued at any later date than February 1st this year, you are able to turn this cookie into a valid
admin cookie for at least the original duration. Make sure your code uses meaningful variable
names, consistent indenting scheme, and comments. [20 pts]
Exercise 2: Lan Manager hash [20 pts]
Back in the days, up to Windows XP, Windows account passwords were hashed using Microsoft’s LAN
Manager (LM) hash function, which works as follows:
Step 1 The password is converted into upper case, null-padded to 14 characters (or truncated to
14 characters), and split into two 7-character halves.
Step 2 Each half is separately converted into a DES key. This key is used to encrypt the ASCII
string “KGS!@#$%”, producing an 8-byte value.
Step 3 The two 8-byte values are concatenated, resulting in a 16-byte hash.
1. Suppose the attacker obtains a file with N hashed passwords. How much work would he need to do,
at most, to crack these passwords by brute-force search? Show your calculations. Express the result
in scientific notation (m × 10n, m ∈ R < 10, n ∈ N), and round it to two decimals. Assume that
users could type any of the 95 printable characters found on a US keyboard i.e., letters, numbers,
symbols, and punctuation marks, which are represented by codes 32 to 126 in the ASCII table.
Passwords could be any length. [15 pts]
2. Knowing that a single modern NVIDIA GeForce RTX 4090 GPU can perform 151.1 GH/s for LM,2
how long would it take an attacker with one such GPU to crack these N hashes? Assume that the
overhead of matching a 64-bit string in a list of 2N 64-bit strings is negligible. [5 pts]
Exercise 3: PKCS#7 padding [20 pts]
The PKCS#7 padding scheme is commonly used to pad irregularly-sized plaintext messages to a specific
block length before encryption, and is described in RFC5652. The algorithm simply consists in appending
the required number of bytes up to nearest multiple of the block length. The value of each appended byte
is equal to the number of bytes added. The maximum length of the pad is therefore 255. If the plaintext
size is already a multiple of the block length, padding is still required. In this case, an entire block
of padding bytes will be used. To remove the padding after decryption, the last byte of the decrypted
ciphertext is read, which indicates how many bytes (of the same value) should be stripped from the end.
For this exercise, do NOT use any library/package in your code.
1. Write a function pkcs(plaintext, length) in Python that takes a plaintext (plaintext) and a
desired block length (length) as input and applies the PKCS#7 padding scheme. The function
should return the padded input. An exception should be thrown if the block length is greater than
the maximum pad length, using: raise Exception("Invalid block size")
For instance, for the message "YELLOW SUBMARINE" and a block size of 20, the output should be
"YELLOW SUBMARINEx04x04x04x04". [5 pts]
2See Hashcat benchmark here: https://gist.github.com/Chick3nman/32e662a5bb63bc4f51b847bb422222fd
2
2. Write a function validate pkcs(plaintext, length) in Python that verifies the validity of the
padding, and returns an unpadded string. The function should throw exceptions using raise
Exception("Invalid padding") when: 1) the length of the plaintext indicates that no padding
has been used; 2) the value for the pad length is incompatible with the block length; 3) the value
of the padding bytes is incorrect. [15 pts]
Prepare a single Python file named exercise3.py that contains both functions.
Make sure to use the exact exception messages given above throughout this exercise;
otherwise, your function will not be evaluated properly for assessment.
Exercise 4: Near collisions [30 pts]
Referring to the exercise given in Lecture 4 (slide 23), find a “near collision” on SHA-256 by hashing
values that must contain your student ID. A near collision is defined as a pair of inputs which hash to
values that share the same first n bits. We define n = 34 for this exercise.
One method of finding such collisions is to hash an increasing counter (concatenated to your student
ID) and keep n-bit prefixes in a dictionary. If you encounter a prefix you have already seen, you found a
near collision.
1. Provide a function find near collisions(studentid) that takes as input your student ID as a
string in the format 12345678 (without letter) and outputs a tuple of binary strings (val1, val2) that
are near collisions, and studentid is a substring of each value. Your program should terminate
within one minute on a reasonably modern laptop and with a correct output. [20 pts]
2. Provide a function get values() that returns a tuple of binary strings (val1, val2) that you have
previously computed and that satisfy the above criteria. Simply hardcode those values and return
them. [10 pts]
Example of correct outputs for student ID=12345678: (b‘12345678288576’, b‘12345678335737’).
Prepare a single Python file named exercise4.py that contains both functions.
Questions?
If you need a clarification about an exercise requirements, you can contact the following TA:
Bowen CUI: bowen.cui@connect.polyu.hk
TAs will not tell you whether your approach is correct or not, whether you got the right answer, etc.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代做AST20201、代寫Java編程設計
  • 下一篇:代寫CPS 1032、Java/Python程序代做
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    亚洲黄色网址大全| 黑人狂躁日本娇小| 特级西西www444人体聚色| 久久日免费视频| 911亚洲精选| 欧美性猛交xxxx乱大交少妇| 黑森林av导航| 亚洲丝袜在线观看| 久久久精品成人| 免费a v网站| 熟女人妻一区二区三区免费看| 干b视频在线观看| 欧美a级片免费看| 高清国产在线观看| 亚洲av无码国产精品麻豆天美| 国产人妻大战黑人20p| 任你操精品视频| 国产免费无遮挡吸奶头视频| 右手影院亚洲欧美| 欧美熟妇一区二区| 国产制服丝袜在线| 欧美高清性xxxx| a级大片在线观看| xxxxx在线观看| 中国av免费看| 天天躁日日躁aaaa视频| 免费毛片视频网站| 公肉吊粗大爽色翁浪妇视频| 亚洲黄色免费视频| 亚洲欧美卡通动漫| 91porn在线| 亚洲天堂视频一区| www.av成人| 国偷自产av一区二区三区麻豆| bl动漫在线观看| zjzjzjzjzj亚洲女人| 亚洲av成人无码一二三在线观看| 精品人妻一区二区三区日产| 69av.com| 在线观看免费看片| 黄色国产在线观看| 制服丨自拍丨欧美丨动漫丨| 性折磨bdsm欧美激情另类| 日本xxxx裸体xxxx| 国产精品夜夜夜爽阿娇| 欧美一级片在线免费观看| 欧洲美一区二区三区亚洲 | 污污免费在线观看| 香蕉久久久久久av成人| 黄色短视频在线观看| 男女男精品视频网站| 理论片大全免费理伦片| 女性裸体视频网站| 日本少妇毛茸茸| 一级片一级片一级片| 亚洲精品久久一区二区三区777| 91视频免费观看网站| 成人免费黄色小视频| 亚洲黄色免费视频| 熟妇人妻久久中文字幕| 波多野结衣亚洲一区二区| 欧美午夜激情影院| 中国极品少妇xxxx| 日本r级电影在线观看| 久久久久9999| 呦呦视频在线观看| 一级黄色大片免费看| 极品久久久久久| 我要看黄色一级片| 日本二区三区视频| 手机在线中文字幕| 国产精品免费在线视频| 亚洲欧美综合7777色婷婷| 日韩女同一区二区三区| 中字幕一区二区三区乱码| 午夜精产品一区二区在线观看的| 久久国产精品影院| 日本丰满少妇裸体自慰| 自拍偷拍亚洲天堂| 中文字幕第24页| 五月婷婷婷婷婷| 国产ts在线播放| 三级黄色免费观看| 特级片在线观看| 在线观看一区二区三区四区| 动漫美女无遮挡免费| 2一3sex性hd| 波多野在线播放| 少妇高潮惨叫久久久久| 日本黄色三级网站| yy1111111| 任你操精品视频| 日本性生活一级片| 国产人妻大战黑人20p| 亚洲精品久久久久久国| 色诱av手机版| youjizz亚洲女人| 无码人妻一区二区三区精品视频| 美国黄色一级毛片| 色无极影院亚洲| 久久精品视频免费在线观看| 久草免费资源站| 激情五月深爱五月| 久久精品女同亚洲女同13| 中文字幕免费视频| 国产免费一区二区三区四区| 韩国黄色一级片| 国产极品美女在线| 国产一级免费片| 很污很黄的网站| 免费的av网站| 亚洲911精品成人18网站| 在线国产视频一区| 91超薄肉色丝袜交足高跟凉鞋| 日本一区二区视频在线播放| 综合五月激情网| 亚洲香蕉中文网| 一级免费黄色录像| 全黄一级裸体片| 国产成人av无码精品| 深夜福利网站在线观看| 9.1片黄在线观看| 波多野结衣av在线观看| youjizz.com日本| 国产精品 欧美激情| аⅴ天堂中文在线网| 我和岳m愉情xxxⅹ视频| 中文字幕99页| 亚洲av午夜精品一区二区三区| 黄色三级生活片| 成人无码www在线看免费| 女同性恋一区二区三区| 国产伦理在线观看| 中文字幕99页| 国产二级一片内射视频播放 | 中国xxxx性xxxx产国| 久久午夜精品视频| 国产精品www爽爽爽| 国产一级久久久久毛片精品| 国产人妻大战黑人20p| 国产视频三区四区| 超碰97av在线| 黄视频网站免费看| 久久r这里只有精品| 亚洲v在线观看| 99久久人妻无码中文字幕系列| 国产精品伦子伦| zjzjzjzjzj亚洲女人| 巨胸大乳www视频免费观看| 中文字幕狠狠干| 亚洲精品91在线| 国产精品三区在线观看| 亚洲啪av永久无码精品放毛片| 欧美成人午夜精品免费| 水蜜桃av无码| youjizz亚洲女人| 青青草原在线免费观看| 欧美激情 亚洲| 女人十八毛片嫩草av| 久久久久99人妻一区二区三区| 国产人妻一区二区| 乱老熟女一区二区三区| 国产一精品一aⅴ一免费| 国产精品久久无码| 情侣偷拍对白清晰饥渴难耐| 国产成人精品综合久久久久99| 中文字幕国产专区| 日韩丰满少妇无码内射| 人妻精油按摩bd高清中文字幕| 国产 欧美 在线| 精品国产精品国产精品| 高潮毛片无遮挡| 老司机av网站| 无遮挡aaaaa大片免费看| 欧美性x x x| 国产三级av在线播放| 成年人性生活视频| 成人激情五月天| 手机av免费看| xfplay5566色资源网站| 69xx绿帽三人行| 97在线观看免费高| 国产免费嫩草影院| 国产男男chinese网站| 麻豆网站免费观看| 三级影片在线看| 一级性生活免费视频| 国产精品久久久久无码av色戒| 亚洲中文字幕一区| 日韩一区二区三区四区在线| 国产精品天天干| 国产精品国产三级国产专业不 | 国产精品无码电影| 日本少妇高清视频| 日韩一级片大全| 极品盗摄国产盗摄合集| 日韩一区二区不卡视频| 天天操天天摸天天舔| 美女洗澡无遮挡| 日本综合在线观看|