日本欧洲视频一区_国模极品一区二区三区_国产熟女一区二区三区五月婷_亚洲AV成人精品日韩一区18p

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)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • NBA直播 短信驗證碼平臺 幣安官網下載 歐冠直播 WPS下載

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

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

    日本欧洲视频一区_国模极品一区二区三区_国产熟女一区二区三区五月婷_亚洲AV成人精品日韩一区18p

              9000px;">

                        欧美精品少妇一区二区三区| 日韩欧美精品在线视频| 99精品视频在线观看| 日韩久久精品一区| 久久精品99久久久| 久久精品亚洲一区二区三区浴池| 国产精品一二三| 国产精品久久久久精k8| 欧美亚洲高清一区| 极品美女销魂一区二区三区免费| 久久久久久久久久久黄色| 成人精品国产免费网站| 亚洲一区二区三区视频在线 | 3751色影院一区二区三区| 秋霞影院一区二区| 亚洲日本一区二区三区| 欧美精品乱码久久久久久| 黄色日韩三级电影| 亚洲综合小说图片| 国产视频在线观看一区二区三区| 色婷婷久久99综合精品jk白丝| 日韩精品亚洲一区| 日韩一区日韩二区| 欧美一级视频精品观看| 91免费观看国产| 国产精品99精品久久免费| 亚洲一本大道在线| 中文字幕 久热精品 视频在线| 欧美亚洲综合一区| 成人伦理片在线| 国内久久精品视频| 美女视频黄 久久| 亚洲精品中文在线观看| 精品久久久久久最新网址| 91视频精品在这里| 成人精品在线视频观看| 黑人精品欧美一区二区蜜桃 | 亚洲第一av色| 亚洲视频免费观看| 国产精品久久久久aaaa樱花| 日韩三级电影网址| 日韩一区二区在线看片| 51午夜精品国产| 欧美一区二区三区不卡| 欧美人伦禁忌dvd放荡欲情| 色综合天天综合网国产成人综合天| 国产在线精品一区在线观看麻豆| 日本系列欧美系列| 日本欧美大码aⅴ在线播放| 亚洲中国最大av网站| 亚洲精品国产精品乱码不99| 中文字幕视频一区| 亚洲欧美日韩中文播放 | 青青草伊人久久| 丝袜亚洲另类欧美综合| 日韩激情视频在线观看| 美女免费视频一区二区| 国模套图日韩精品一区二区 | 欧美在线啊v一区| 91亚洲精品一区二区乱码| 国产一区二区精品久久91| 日韩国产精品久久久久久亚洲| 亚洲成av人**亚洲成av**| 丝袜美腿亚洲综合| 狠狠色丁香九九婷婷综合五月| 国产一区激情在线| 91理论电影在线观看| 欧美体内she精视频| 欧美一区二区人人喊爽| 久久久噜噜噜久久人人看| 中文字幕在线一区| 亚洲sss视频在线视频| 激情综合网av| 成人午夜视频在线观看| 欧美日韩一卡二卡三卡| 日韩欧美国产综合在线一区二区三区| 精品入口麻豆88视频| 亚洲国产精品精华液2区45| 亚洲激情图片qvod| 麻豆国产精品视频| 99综合电影在线视频| 欧美性猛交xxxx乱大交退制版| 51午夜精品国产| 中文av一区特黄| 偷拍自拍另类欧美| 国产老女人精品毛片久久| 欧美性受xxxx黑人xyx| 精品理论电影在线| 亚洲丝袜另类动漫二区| 久久成人18免费观看| 色呦呦网站一区| 国产色婷婷亚洲99精品小说| 亚洲午夜日本在线观看| 国产v综合v亚洲欧| 欧美日韩国产免费一区二区| 国产精品污网站| 蜜臀a∨国产成人精品| 91美女片黄在线| 久久久777精品电影网影网 | 在线区一区二视频| 精品国内片67194| 亚洲国产一区视频| 色综合天天综合| 国产日韩欧美一区二区三区综合| 日韩—二三区免费观看av| 91免费版在线| 国产精品拍天天在线| 国产一区二区按摩在线观看| 欧美美女一区二区在线观看| 亚洲精品自拍动漫在线| www.亚洲免费av| 国产精品久久久久一区二区三区 | 一区二区三区精品| caoporn国产精品| 欧美国产精品久久| 国内精品久久久久影院一蜜桃| 欧美一二区视频| 美腿丝袜亚洲一区| 欧美精品自拍偷拍| 亚洲国产精品一区二区久久恐怖片| 成人99免费视频| 国产精品久久久久久久裸模| 国产成人aaaa| 日本一区二区免费在线| 国产成人免费视频网站| 国产网红主播福利一区二区| 国产裸体歌舞团一区二区| 欧美一卡2卡3卡4卡| 美女视频黄久久| 精品国产乱码久久久久久免费 | 在线观看欧美黄色| 亚洲制服丝袜在线| 欧美综合天天夜夜久久| 日本视频一区二区| 精品动漫一区二区三区在线观看 | 麻豆成人久久精品二区三区小说| 日韩丝袜情趣美女图片| 国产一区日韩二区欧美三区| 国产精品理论片在线观看| 色哟哟精品一区| 无吗不卡中文字幕| 亚洲精品在线电影| 99久久精品99国产精品| 亚洲尤物在线视频观看| 欧美精品123区| 国产乱码精品一品二品| 亚洲欧洲色图综合| 51精品视频一区二区三区| 久久av资源网| 亚洲黄网站在线观看| 日韩亚洲欧美成人一区| 成人晚上爱看视频| 婷婷综合另类小说色区| 国产欧美视频在线观看| 欧美日韩一级二级| 大胆欧美人体老妇| 五月婷婷久久丁香| 国产精品视频一区二区三区不卡| 欧美性猛片xxxx免费看久爱| 国产精品一线二线三线精华| 一区二区三区四区高清精品免费观看 | 欧美激情在线观看视频免费| 在线日韩一区二区| 国产激情视频一区二区三区欧美 | 成人h动漫精品| 奇米影视7777精品一区二区| 国产精品久久久久毛片软件| 欧美一区二区视频在线观看2022 | 亚洲色图视频网站| 精品乱人伦小说| 欧美日韩一区二区电影| 丰满放荡岳乱妇91ww| 奇米精品一区二区三区在线观看一| 中文字幕一区二区三区av| 日韩欧美激情一区| 欧美日本韩国一区| 日本高清不卡一区| 成人精品高清在线| 国产在线一区观看| 久久爱www久久做| 欧美bbbbb| 天天色综合天天| 亚洲图片自拍偷拍| 亚洲男人天堂av网| 中文字幕欧美日韩一区| 欧美一级生活片| 制服.丝袜.亚洲.中文.综合| 91蜜桃免费观看视频| 成人黄色免费短视频| 国产激情一区二区三区| 国产在线国偷精品产拍免费yy | 日韩免费高清av| 欧美日韩视频一区二区| 欧美性生活影院| 91欧美激情一区二区三区成人| 成人福利视频在线看| 成人国产精品免费网站| 岛国精品一区二区| av网站免费线看精品| 99久久er热在这里只有精品15|