精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕

COMP 3334代做、代寫Python語(yǔ)言編程

時(shí)間:2024-03-20  來(lái)源:  作者: 我要糾錯(cuò)



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.
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標(biāo)簽:

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:代做AST20201、代寫Java編程設(shè)計(jì)
  • 下一篇:代寫CPS 1032、Java/Python程序代做
  • 無(wú)相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗(yàn)證碼平臺(tái) 理財(cái) WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕
    <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
    <ul id="e4iaa"></ul>
    <blockquote id="e4iaa"><tfoot id="e4iaa"></tfoot></blockquote>
    • <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
      <ul id="e4iaa"></ul>
      <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp><ul id="e4iaa"></ul>
      <ul id="e4iaa"></ul>
      <th id="e4iaa"><menu id="e4iaa"></menu></th>
      不卡大黄网站免费看| 国产一区二区精品久久99| 国产日韩欧美精品电影三级在线| 日韩欧美国产高清| 日韩欧美在线网站| 精品国产免费人成电影在线观看四季| 日韩欧美不卡一区| 国产日产精品一区| 亚洲日本韩国一区| 亚洲综合视频在线观看| 亚洲国产视频一区| 日韩精品亚洲一区| 久久99精品久久久久婷婷| 国产精品中文字幕日韩精品 | 成人国产精品视频| 99re热视频精品| 欧美日韩在线三级| 精品国产污污免费网站入口| 国产人伦精品一区二区| 成人欧美一区二区三区视频网页| 亚洲毛片av在线| 丝袜美腿亚洲色图| 国产精品一区二区在线观看网站| 岛国av在线一区| 欧美午夜精品久久久久久超碰| 91精品国产综合久久福利| 日韩一区二区免费高清| 久久精品视频网| 一区二区三区国产精华| 久久99在线观看| 色婷婷激情综合| 精品女同一区二区| 亚洲自拍偷拍欧美| 国产美女在线观看一区| 在线区一区二视频| 欧美激情一区二区在线| 亚洲午夜久久久久中文字幕久| 精品伊人久久久久7777人| 色综合久久66| 久久久久久久久蜜桃| 亚洲一区影音先锋| 国产91露脸合集magnet| 日韩欧美在线影院| 一区二区三区四区在线| 国产成人在线色| 欧美刺激脚交jootjob| 亚洲一区在线电影| 成人免费视频播放| 精品日韩一区二区三区免费视频| 亚洲视频精选在线| 丁香婷婷综合网| 久久综合五月天婷婷伊人| 亚洲高清免费视频| 在线观看亚洲精品| 18欧美乱大交hd1984| 国产福利一区二区| 2020日本不卡一区二区视频| 亚洲国产欧美一区二区三区丁香婷| 国产激情一区二区三区四区| 91精品国产色综合久久不卡蜜臀 | 欧美高清激情brazzers| 亚洲色图在线视频| www.99精品| 国产精品狼人久久影院观看方式| 国产尤物一区二区| 精品国产乱码久久久久久闺蜜| 日韩制服丝袜先锋影音| 欧美视频中文字幕| 亚洲成人自拍一区| 欧美日韩小视频| 亚洲r级在线视频| 欧美色倩网站大全免费| 亚洲午夜羞羞片| 欧美精品第一页| 日本午夜一本久久久综合| 91精品国产全国免费观看| 欧美aaaaa成人免费观看视频| 欧美日韩视频在线一区二区| 亚洲影院免费观看| 欧美日韩激情在线| 久久国产尿小便嘘嘘尿| 久久亚洲私人国产精品va媚药| 国产精品乡下勾搭老头1| 国产亚洲精品bt天堂精选| 成人午夜视频免费看| 国产精品嫩草久久久久| 在线观看一区日韩| 日本少妇一区二区| 国产亚洲精品久| 色妞www精品视频| 午夜欧美视频在线观看| 日韩精品一区二区三区中文精品| 国产一区二区三区四区五区美女| 亚洲国产高清aⅴ视频| 色综合婷婷久久| 国产毛片精品视频| 国产精品丝袜一区| 欧美午夜精品免费| 国产麻豆一精品一av一免费| 国产精品欧美一区二区三区| 在线观看视频一区二区| 久久精品国产一区二区三| 欧美激情艳妇裸体舞| 欧美三级日韩在线| 国产毛片精品国产一区二区三区| 国产精品高潮呻吟| 91精品国产一区二区三区香蕉| 国产成人免费视频网站| 亚洲成人精品一区二区| 国产日产欧美一区二区视频| 欧美色精品天天在线观看视频| 久久精品国产亚洲一区二区三区| 成人欧美一区二区三区| 欧美一区二区三区在线| 91麻豆国产香蕉久久精品| 蜜桃精品在线观看| 亚洲一区二区三区自拍| 久久老女人爱爱| 91精品国产aⅴ一区二区| 99国产精品久| 国产精品一卡二卡| 日本大胆欧美人术艺术动态| 亚洲三级小视频| 久久综合九色综合97婷婷女人| 欧美日韩国产在线播放网站| 成人sese在线| 国产精品一区久久久久| 男人的j进女人的j一区| 亚洲国产美女搞黄色| 国产精品丝袜在线| 国产欧美日韩不卡| 精品国产制服丝袜高跟| 日韩欧美一级片| 9191久久久久久久久久久| 在线中文字幕一区二区| 不卡一卡二卡三乱码免费网站| 国产精品一区二区果冻传媒| 全部av―极品视觉盛宴亚洲| 午夜亚洲国产au精品一区二区| 亚洲男人的天堂在线aⅴ视频| 亚洲国产精品成人综合| 国产亚洲精品福利| 国产欧美日韩在线看| 久久久精品tv| 日本一区免费视频| 亚洲国产成人午夜在线一区| 国产亚洲欧洲一区高清在线观看| 久久丝袜美腿综合| 亚洲精品一区二区三区在线观看| 欧美一区二区精品| 欧美一区日本一区韩国一区| 欧美一区永久视频免费观看| 3d成人动漫网站| 日韩精品在线网站| 国产欧美日韩麻豆91| 国产日韩欧美一区二区三区综合 | 91麻豆免费看片| 91视频.com| 欧美日韩和欧美的一区二区| 欧美日韩国产首页| 日韩精品一区二区三区在线播放| 精品国产乱码久久久久久影片| 久久婷婷综合激情| 中文字幕免费不卡| 一区二区日韩av| 日韩精品亚洲专区| 国产精品69毛片高清亚洲| www.av亚洲| 在线播放/欧美激情| 精品三级在线看| 亚洲欧洲韩国日本视频| 亚洲动漫第一页| 久久精品国产亚洲a| 国产麻豆精品一区二区| 91色乱码一区二区三区| 欧美区在线观看| 欧美国产日韩a欧美在线观看| 亚洲欧美视频在线观看视频| 日韩精品亚洲一区| 成人性生交大片免费看视频在线 | 国产精品对白交换视频| 亚洲一区二区三区中文字幕在线| 秋霞影院一区二区| 成人av网站在线| 欧美一区二区三区日韩| 久久久久久久久久看片| 亚洲一二三区在线观看| 国产精品99久久久| 欧美日韩国产一区二区三区地区| 国产亚洲精品bt天堂精选| 一区二区三区日韩欧美| 国产乱码精品一区二区三区忘忧草 | 首页欧美精品中文字幕| 国产成人精品免费网站| 欧美久久久久久久久| 中文字幕精品在线不卡| 久久国产精品露脸对白| 欧美三级一区二区| 国产精品狼人久久影院观看方式| 美女尤物国产一区|