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

COMP3334代做、代寫Python程序語(yǔ)言
COMP3334代做、代寫Python程序語(yǔ)言

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



COMP3334 Project
End-to-end encrypted chat web application
Semester 2, 2023/2024
Nowadays, web services are the most
common form of applications that users are
exposed to. Web browsers become the most
popular application on a computer that
enables users to access those web services.
Ensuring the security of web services is
essential for the Internet. Moreover, privacy
of communications is an important feature of
modern times. Your job is to implement an
end-to-end encrypted chat web application
and secure various aspects of the website.
Overview
Objectives
1. Adapt a basic chat web application to become a secure E2EE chat web app
2. Comply with some of the requirements in NIST Special Publication 800-63B “Digital
Identity Guidelines – Authentication and Lifecycle Management” for US federal
agencies (which is also a reference for other types of systems)
3. Implement a secure MFA mechanism based on passwords and OTP (or FIDO2)
4. Encrypt communications between two users so that the server does not know the
content of the messages (E2E encryption)
5. Protect communications in transit by configuring a modern TLS deployment
6. Package a docker image of your web app
Requirements (authentication)
1. From NIST Special Publication 800-63B:
1. Comply with all SHALL and SHOULD requirements from sections listed below
2. Use the following authenticators:
• User-chosen Memorized Secret (i.e., password/passphrase)
• and Single-Factor OTP Device (e.g., Google Authenticator)
• or Single-Factor Cryptographic Device (e.g., Yubikey) if you have one
• and Look-Up Secrets (recovery keys)
• Comply with related requirements in §5.1 and §4.2.2
• §5.1.1.2: “Memorized secrets SHALL be salted and hashed using a suitable one-way key
derivation function”
• See our Password Security lecture for an appropriate function
• Memorized Secret Verifiers (§5.1.1.2)
• Choose “Passwords obtained from previous breach corpuses” and refer to
https://haveibeenpwned.com/API/v3#PwnedPasswords for the corpus to check against
• §5.2.8 and §5.2.9 are automatically complied
Requirements (authentication)
1. From NIST Special Publication 800-63B:
3. §5.2.2: Implement rate-limiting mechanisms AND image-based CAPTCHAs
4. Implement new account registration and bind authenticators (OTP/Yubikey and recovery keys) at
the same time
• Optional: provide a way to change authenticators after account registration
5. §7.1: Implement proper session binding requirements
6. Exceptions:
• OTP authenticators — particularly software-based OTP generators — SHOULD discourage and
SHALL NOT facilitate the cloning of the secret key onto multiple devices.
• Google Authenticator and related apps are OK
Requirements (E2EE chat)
2. Once users are logged in, secure chat messages between two users in a way so that the server cannot
decrypt the messages
1. Use the ECDH key exchange protocol to establish a shared secret between two users
• Leverage the WebCrypto API, see demo https://webkit.org/demos/webcrypto/ecdh.html
• Exchanged information during the key exchange can be sent through the server
• The server is trusted not to modify messages of the key exchange
• Choose P-384 as the underlying curve
2. Derive two 256-bit AES-GCM encryption keys and two 256-bit MAC keys from the shared secret
using HKDF-SHA256
• One key for encryption between user1 to user2, and another one from user2 to user1
• Using WebCrypto API again, see https://developer.mozilla.org/enUS/docs/Web/API/HkdfParams
• The salt should be unique so another key derivation in the future produces different keys, use
for instance a counter starting at 1
• The info parameter should represent the current context (e.g., “CHAT_KEY_USER1to2” for the
key for user1user2, and “CHAT_MAC_USER1to2” for the MAC key for user1user2)
Requirements (E2EE chat)
2. Once users are logged in, secure chat messages between two users in a way so that the server cannot
decrypt the messages
3. Messages will be encrypted using AES in GCM mode
• 96-bit IVs are counters representing the number of messages encrypted with the same key
• Note: GCM does not require unpredictable IVs, but unique IVs
• Send the IV together with the ciphertext to the recipient
• As a recipient, verify that IV𝑖𝑖 > IV𝑖𝑖−1 to prevent replay attacks
• Protect the IV with HMAC-SHA256 using the derived MAC key to prevent the attacker from
choosing IVs
• Associated data should reflect the current context (e.g., “CHAT_MSG_USER1to2”)
• Authentication tags should be 128 bits
4. Store all key material in the HTML5 Local Storage of the browser to be retrieved after the browser
is reopened
5. Display the history of previous messages being exchanged + new messages
• If Local Storage has been cleared, previous messages cannot be decrypted, show warning
Requirements (E2EE chat)
2. Once users are logged in, secure chat messages between two users in a way so that the server cannot
decrypt the messages
6. All symmetric keys and IVs should be re-derived from the shared secret when user clicks on a
“Refresh” button in the chat (not the browser refresh button), using a new salt
• The participant that requests a change should inform the other party with a special message
composed of the last IV that has been used, the string “change”, altogether protected with
the old MAC key AND the new MAC key
• Two different MACs over the message
• The other party should verify the old MAC before processing the message, then derive
new keys and verify again the new MAC before accepting the new keys
• Both parties should show a message “Keys changed” in the chat history
• Old keys should be kept to decrypt older messages when the browser is reopened, you
should identify which set of keys to use for a given message based on the preceding values
sent during the key exchange (i.e., keep track of user public keys)
• Key exchange messages older than a minute should not be considered as a fresh key
exchange to engaged into
Requirements (E2EE chat)
2. Once users are logged in, secure chat messages between two users in a way so that the server cannot
decrypt the messages
7. When the Local Storage is cleared, or when there is no shared secret for a given recipient, the
sender should initiate the ECDH key exchange using a special message and the recipient should
engage in the key exchange even when there had been a shared secret previously established
8. Chat messages should be encoded using UTF-8, and network messages between users should be
formatted in JSON using your own schema (e.g., {“type”:”ECDH”, “key”:”…”}, {“type”:”msg”,
“ciphertext”:”…”, “IV”:”…”, “MAC”:”…”})
9. Use console.log() to log all crypto operations (including key, IV, plaintext, etc.)
• It should be visually obvious that IVs are not reused, keys change when needed (see next
requirements), etc.
10. The chat app should be protected against cross-site request forgery (CSRF), cross-site scripting
(XSS), and SQL injection attacks
Requirements (TLS)
3. Communications should be encrypted in transit using TLS with the following configuration:
• Reuse Mozilla’s “modern” configuration for nginx, and change it as needed:
• https://ssl-config.mozilla.org/
1. TLS version 1.3 only
2. x25519 Elliptic Curve Group only
3. TLS_CHACHA20_POLY1305_SHA256 cipher suite only
4. No OCSP stappling (since you will use a self-signed CA certificate)
5. HSTS for one week
6. TLS certificate requirements:
1. X.509 version 3
2. ECDSA public key over P-384
3. SHA384 as hashing algorithm for signature
4. CA flag (critical): false
5. Key Usage (critical) = Digital Signature
6. Extended Key Usage = Server Authentication
7. Include both Subject Key Identifier and Authority Key Identifier
8. Validity period = 90 days
Requirements (TLS)
3. Communications should be encrypted in transit using TLS with the following configuration:
7. The website should be hosted at
https://group-[your-group-number].comp3334.xavier2dc.fr:8443/
• Group #10 will be at group-10.comp3334.xavier2dc.fr
8. All subdomains *.comp3334.xavier2dc.fr will redirect to 127.0.0.1
• You can effectively use “group-X.comp3334.xavier2dc.fr” instead of “localhost”
• If you do not host the docker container on localhost,
add a manual entry in your hosts file
• Linux: /etc/hosts
• Windows: C:WindowsSystem32driversetchosts
9. Issue the certificate from the given CA certificate and private key
• Use the domain name corresponding to your group
• Domain should appear as both Common Name and Subject Alternative Name
10. The CA certificate is domain-constrained to subdomains of comp3334.xavier2dc.fr, meaning
you can safely trust it on your computer (nobody can generate valid certificates for other
domains)

Simple Chat Demo
1. Deploy the docker container using the following line within the folder that contains the dockercompose.yaml file:
$ sudo docker-compose up -d
2. So far, the chat app works over plain HTTP on port 8080, access it at:
http://group-0.comp3334.xavier2dc.fr:8080
3. Open a new private window of your browser and access the website again
1. Chrome:
2. Firefox:
4. Login as Alice (password: password123) on the first window
5. Login as Bob (password: password456) on the second (private) window
6. Select Bob as contact from Alice’s chat, select Alice as contact from Bob’s chat
7. Send messages each other!
8. When modifying the server-side (app.py) or client-side (login.html, chat.html), simply restart the
docker container, you do not need to rebuild the container:
$ sudo docker restart [you-container-name]-webapp-1
Areas of assessments
1. Explanations of your solution and design [50%]
• Provide list of features/requirements implemented
• Describe how your solution works, especially explain how user passwords are
stored, verified, which libraries do you use, how key materials are derived, how
do you store them, their size, how do you generate the domain certificate, etc.
• Show autonomy and creativity when requirements allow
2. Implementation of your solution & demo [50%]
• Follow proper coding style, write informative comments, give concise and
relevant variable names, respect indentation, stay consistent in style
• Make things work!
Submission
• Submit a ZIP’d file containing:
1. Modified chat app docker-compose stack
• “sudo docker-compose up -d” should work!
• Accessing https://group-X.comp3334.xavier2dc.fr:8443/ should work with
a valid certificate issued by the given CA
• Group number is the one you registered on Blackboard
2. PDF report
3. 8-minute video with a demonstration of your solution
• User registration + new chat with existing user + refresh website & reload chat
4. Statement of individual contributions
• Who did what, how much % of the work does that represent?
• Format will be given to you later
• Deadline for submission is Sunday, April 14 @ 23:59 (hard deadline)
Questions?
Technical questions:
• CUI Bowen bowen.cui@connect.polyu.hk
Administrative questions:
• LYU Xinqi xinqi.lyu@connect.polyu.hk
FAQ
1. Can I use a library?
• Depends, does it replace the whole chat protocol with a better and secure chat?
Then, no. You still need to implement a secure chat protocol.
• Does the library implement part of the requirements (e.g., proper session
management, OTP, hashing algorithm, etc.)? Then, yes.
2. How can I rebuild the docker container if I need to modify, say, the nginx config?
1. docker-compose down -v
2. docker-compose build --no-cache
3. docker-compose up -d
3. How can I debug errors?
• docker logs [your-container]
FAQ
4. How does the web chat application work?
1. It is written in Python using Flask
2. It is running behind the WSGI server Gunicorn
3. Which is running behind the reverse proxy nginx (which should provide TLS)
4. The front-end is written in HTML and Javascript
5. The server app writes messages into a MySQL database

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

標(biāo)簽:

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:COMP 330代做、Python設(shè)計(jì)程序代寫
  • 下一篇: CISC3025代寫、代做c++,Java程序設(shè)計(jì)
  • 無(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>
      久久综合色鬼综合色| 欧美一区二区三区视频在线观看| 日韩在线播放一区二区| 亚洲一区二区三区激情| 玉米视频成人免费看| 亚洲老妇xxxxxx| 亚洲在线视频一区| 偷偷要91色婷婷| 蜜桃av一区二区| 国产精品一区免费在线观看| 成人免费看视频| 97精品久久久久中文字幕| 色婷婷综合久久久久中文一区二区 | 日韩成人午夜精品| 日韩精品亚洲专区| 久久99精品久久只有精品| 国产精品69久久久久水密桃 | 亚洲三级电影全部在线观看高清| 中文字幕亚洲不卡| 午夜精品福利在线| 国产一区二区女| 99久久精品国产一区二区三区| 欧美三区在线观看| 精品日韩一区二区三区免费视频| 国产精品久久久久影院| 亚洲va欧美va国产va天堂影院| 久久精品国产亚洲a| 99久久综合色| 欧美sm极限捆绑bd| 有坂深雪av一区二区精品| 美女视频一区在线观看| www.99精品| 欧美mv日韩mv国产网站app| 亚洲欧美综合另类在线卡通| 免费在线看成人av| 色综合久久久久综合体| 精品日韩成人av| 亚洲成人自拍一区| 成人性色生活片免费看爆迷你毛片| 精品视频在线免费看| 国产欧美一区二区三区鸳鸯浴| 亚洲电影一级黄| www.激情成人| 久久精品亚洲麻豆av一区二区| 一个色综合av| bt7086福利一区国产| 精品国精品国产| 天天色天天操综合| 99re热这里只有精品视频| 精品国产髙清在线看国产毛片| 亚洲国产综合色| 99国产欧美久久久精品| 国产亚洲成aⅴ人片在线观看| 亚洲午夜久久久久久久久电影院| 成人免费毛片app| 久久蜜臀中文字幕| 另类调教123区| 欧美日韩aaaaa| 一二三区精品福利视频| 97se狠狠狠综合亚洲狠狠| 久久精品视频在线免费观看| 捆绑紧缚一区二区三区视频| 911精品国产一区二区在线| 亚洲图片激情小说| 成人18视频在线播放| 日本一区免费视频| 国产激情一区二区三区四区| 久久综合九色综合欧美就去吻| 免费不卡在线视频| 日韩一级片在线播放| 免费成人在线视频观看| 91麻豆精品国产91久久久资源速度| 亚洲国产精品一区二区www在线| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品传媒视频| 色呦呦国产精品| 一个色综合av| 欧美一区二区三区免费| 免费视频最近日韩| 精品999在线播放| 国产精品一区二区在线播放| 国产欧美日韩三区| 91污片在线观看| 亚洲午夜在线视频| 欧美精品成人一区二区三区四区| 日韩影院免费视频| 亚洲精品一区二区三区福利| 成人综合在线视频| 亚洲精品网站在线观看| 91超碰这里只有精品国产| 久久机这里只有精品| 欧美激情资源网| 一本色道久久综合精品竹菊| 日韩经典中文字幕一区| 久久网这里都是精品| 色偷偷久久人人79超碰人人澡 | 成人sese在线| 亚洲国产精品影院| 久久久欧美精品sm网站| 色综合中文综合网| 国产精品一区二区在线观看不卡| 国产欧美日韩久久| 欧洲一区二区三区在线| 美国毛片一区二区三区| 国产日韩欧美精品一区| 欧美亚洲高清一区二区三区不卡| 日本午夜精品一区二区三区电影| 国产情人综合久久777777| 欧美性大战久久| 国产jizzjizz一区二区| 婷婷六月综合亚洲| 日韩理论片网站| 久久只精品国产| 欧美三日本三级三级在线播放| 国产永久精品大片wwwapp| 亚洲精品中文在线| 国产亚洲一二三区| 91精品一区二区三区在线观看| 成人app下载| 国产一区二区在线影院| 亚洲高清在线精品| 一区精品在线播放| 久久精品视频免费观看| 欧美精品xxxxbbbb| 色天天综合色天天久久| 国产精品一区二区x88av| 日本亚洲电影天堂| 亚洲v日本v欧美v久久精品| 国产精品乱人伦| 久久久久99精品一区| 欧美一二三区在线| 欧美日韩日日摸| 色猫猫国产区一区二在线视频| 成人一道本在线| 高潮精品一区videoshd| 国产麻豆欧美日韩一区| 精品亚洲国产成人av制服丝袜| 午夜精品国产更新| 亚洲第一主播视频| 亚洲国产cao| 亚洲大片免费看| 亚洲国产精品久久久男人的天堂 | 久久久久久免费毛片精品| 欧美一卡二卡在线观看| 欧美日韩视频在线第一区 | 国产精品 欧美精品| 久久国产精品露脸对白| 日本va欧美va瓶| 日本不卡1234视频| 日本va欧美va欧美va精品| 日韩综合在线视频| 亚洲不卡在线观看| 日本伊人色综合网| 毛片av一区二区| 国产在线日韩欧美| 国产成人三级在线观看| 国产69精品久久777的优势| 懂色av一区二区三区免费观看| 成人综合在线视频| 色综合视频在线观看| 欧美体内she精视频| 欧美丰满少妇xxxxx高潮对白| 欧美一区二区成人| 久久人人97超碰com| 欧美激情一二三区| 亚洲美女屁股眼交| 午夜在线成人av| 国产又粗又猛又爽又黄91精品| 国产高清在线观看免费不卡| 成人激情校园春色| 欧美日韩精品欧美日韩精品一综合| 91麻豆精品国产91久久久| 久久亚洲私人国产精品va媚药| 日韩一区在线看| 日韩精品一区第一页| 国产成人综合亚洲91猫咪| 99久久综合狠狠综合久久| 欧美日韩国产中文| 久久精品日产第一区二区三区高清版 | 日韩一区在线看| 日本女人一区二区三区| 国产成人日日夜夜| 欧美日韩国产欧美日美国产精品| 26uuu欧美| 亚洲国产毛片aaaaa无费看| 国产一区二区导航在线播放| 在线亚洲免费视频| 久久天天做天天爱综合色| 一区二区三区波多野结衣在线观看 | 亚洲男人的天堂在线观看| 日本视频一区二区| 99视频国产精品| 亚洲精品在线一区二区| 亚洲国产精品嫩草影院| 粉嫩高潮美女一区二区三区| 欧美久久久久久蜜桃| 亚洲欧美日本韩国| 成人午夜电影小说| 欧美大白屁股肥臀xxxxxx| 一区二区国产盗摄色噜噜|