久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

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

    久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

    麻豆一区二区三区视频| 亚洲天堂av线| 情侣黄网站免费看| 日韩专区第三页| 毛片毛片毛片毛| 中文字幕色呦呦| 黄色小视频免费网站| 国产精品丝袜久久久久久消防器材| 路边理发店露脸熟妇泻火| 色呦色呦色精品| 在线观看av网页| 成年人在线看片| 国产男女无遮挡| 香港三级韩国三级日本三级| 成人精品视频在线播放| 喜爱夜蒲2在线| 女同性恋一区二区| 成人免费看片视频在线观看| 亚洲精品在线网址| 一级黄色高清视频| 91在线第一页| 天天色天天干天天色| 性久久久久久久久久久久久久| 91日韩精品视频| 亚洲在线观看网站| av电影一区二区三区| 在线视频一二三区| 久久这里只有精品18| 国产人妻777人伦精品hd| 中文字幕日本最新乱码视频| 国产原创中文在线观看| 2022亚洲天堂| 一级在线免费视频| 欧美性受xxxx黒人xyx性爽| 一道本在线观看视频| 在线观看18视频网站| 欧美一区二区视频在线播放| www.日本少妇| 97视频在线免费播放| 日日噜噜夜夜狠狠| 亚洲最新免费视频| 日本手机在线视频| 成人免费视频久久| 久久久久久久久久久久久久久国产| 一区二区三区一级片| 欧美国产视频一区| 日本三级免费观看| 日本中文字幕影院| 日韩精品免费一区| 成人在线免费在线观看| 亚洲国产日韩欧美在线观看| 亚洲一级片av| 日本五级黄色片| 熟妇人妻无乱码中文字幕真矢织江| 粉色视频免费看| www.男人天堂网| 免费看a级黄色片| 黄色高清视频网站| 国产网站免费在线观看| 色乱码一区二区三区在线| 久久久天堂国产精品| 爱福利视频一区二区| 亚洲欧美日韩三级| 久久精品xxx| 亚洲高清在线免费观看| 欧美性受黑人性爽| 黄色av网址在线播放| 亚洲精品性视频| 黄色国产一级视频| 欧美成人乱码一二三四区免费| 国产精品国三级国产av| 国内自拍视频一区| 91网站在线观看免费| 手机在线看福利| av网站大全免费| 182午夜在线观看| 成熟丰满熟妇高潮xxxxx视频| 在线观看免费不卡av| 免费一级特黄特色毛片久久看| 污片在线免费看| 黄色一级视频片| 久久99国产精品一区| 亚洲成色www.777999| 妞干网在线视频观看| 国产高清精品软男同| 热久久精品免费视频| www精品久久| 一区二区三区四区免费观看| 三级在线免费看| 黄色一级视频片| 日韩中文字幕亚洲精品欧美| 天天碰免费视频| 成人免费观看cn| 91精品一区二区三区四区| 最近中文字幕一区二区| 久久久久久久午夜| 黄黄视频在线观看| 九九精品久久久| www黄色在线| 一区二区传媒有限公司| 国产一级不卡视频| 污免费在线观看| jizz大全欧美jizzcom| 北条麻妃在线观看| 日本a在线免费观看| 天堂а√在线中文在线| 欧美国产日韩另类| 日本人视频jizz页码69| 日本www高清视频| 国产精品后入内射日本在线观看| 国产人妻人伦精品| 黄色一级视频播放| 天堂av手机在线| 亚洲精品自拍网| 中文字幕在线观看第三页| 国产精品第12页| 春日野结衣av| 国产精品999视频| 久久久久久久中文| 韩日视频在线观看| 日韩一级性生活片| 青青青青在线视频| 亚洲国产精品无码观看久久| www.国产在线播放| 国产精品videossex国产高清| 今天免费高清在线观看国语| 特级西西人体www高清大胆| 成人免费看片视频在线观看| 国内自拍中文字幕| 欧美国产日韩激情| av之家在线观看| 丰满人妻中伦妇伦精品app| 免费在线激情视频| 狠狠热免费视频| 亚洲77777| 91视频福利网| 大片在线观看网站免费收看| 国产性生活免费视频| 国产综合中文字幕| 黑鬼大战白妞高潮喷白浆| 男女无套免费视频网站动漫| 午夜啪啪小视频| avove在线观看| 久无码久无码av无码| 国产高清精品在线观看| 99热手机在线| 亚洲无在线观看| 国产性生活免费视频| 国产午夜大地久久| 爆乳熟妇一区二区三区霸乳| 久久6免费视频| avav在线播放| 国产日韩成人内射视频| 激情黄色小视频| 在线观看污视频| 欧美三级一级片| 8x8x最新地址| 穿情趣内衣被c到高潮视频| 男人插女人视频在线观看| 成年人黄色片视频| 一级片免费在线观看视频| www.成年人视频| 国产一区亚洲二区三区| 91日韩精品视频| 秋霞无码一区二区| 杨幂毛片午夜性生毛片| 日韩视频一二三| 日本精品一区二区三区四区| 91丝袜超薄交口足| 91九色丨porny丨国产jk| 亚欧美在线观看| av 日韩 人妻 黑人 综合 无码| 欧美亚洲另类色图| 91视频福利网| 国产日产欧美视频| 视频区 图片区 小说区| 欧洲精品一区二区三区久久| 午夜免费福利在线| 日本精品久久久久久久久久| 国产九九在线观看| 久草视频国产在线| 色天使在线观看| 欧美黑人经典片免费观看| 亚洲18在线看污www麻豆| 加勒比成人在线| 爱豆国产剧免费观看大全剧苏畅| 日韩精品 欧美| 四虎影院一区二区| mm1313亚洲国产精品无码试看| 91精品一区二区三区四区| 少妇一级淫免费放| 日韩一级性生活片| 超碰成人在线免费观看| 日韩一级在线免费观看| 成人免费在线视频播放| 国产无遮挡猛进猛出免费软件| 久久久999视频| 欧美高清中文字幕| 天天色天天干天天色| 日本在线一二三区|