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

COMP3334代做、代寫Python程序語言
COMP3334代做、代寫Python程序語言

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



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

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

標簽:

掃一掃在手機打開當前頁
  • 上一篇:COMP 330代做、Python設計程序代寫
  • 下一篇: CISC3025代寫、代做c++,Java程序設計
  • 無相關信息
    昆明生活資訊

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

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

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

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    中文字幕91视频| 男人操女人下面视频| 亚洲成人日韩在线| 国产精品无码无卡无需播放器| 校园春色 亚洲| 懂色av粉嫩av浪潮av| 青青草原在线免费观看| 亚洲午夜精品久久久久久高潮| 北京富婆泄欲对白| 欧美性猛交乱大交| 色www亚洲国产阿娇yao| 欧美性xxxx图片| 性欧美丰满熟妇xxxx性久久久| 黑森林av导航| 亚洲av成人精品一区二区三区| 久久午夜精品视频| 国产伦精品一区二区三区视频女| 91av在线免费| 久久精品国产亚洲AV熟女| 舐め犯し波多野结衣在线观看| 成人免费播放视频| 国产精品成人免费观看| 中文字幕电影av| 一级黄色片毛片| 欧美一区二区三区成人精品| youjizz.com日本| 在线观看国产三级| 天堂久久精品忘忧草| av成人免费网站| 亚洲欧美日韩色| 欧美精品欧美极品欧美激情| 在线观看国产网站| 无码人妻精品一区二区中文| 久久只有这里有精品| 日本xxxxxxxxx18| 色哟哟一一国产精品| 乳色吐息在线观看| 精品欧美一区二区久久久久| 国产精品无码无卡无需播放器| 国产传媒视频在线| 性色av无码久久一区二区三区| 日韩av成人网| 日韩亚洲欧美中文字幕| 少妇人妻丰满做爰xxx| 国产xxx在线观看| 亚洲成人网在线播放| 国产精品丝袜一区二区| 色综合久久五月| 美女100%露胸无遮挡| 亚洲妇女无套内射精| 国产精品密蕾丝袜| 亚洲av无一区二区三区久久| 一级片视频免费看| 国产老头和老头xxxx×| 久久成人激情视频| 久久久男人的天堂| 成年人网站在线观看视频| 亚洲av成人精品一区二区三区| 欧美人与禽zoz0善交| 国产午夜在线一区二区三区| 一级免费黄色录像| 国产精品一二三区在线观看| 美女扒开腿免费视频| h色网站在线观看| 成人免费无遮挡无码黄漫视频| 2021亚洲天堂| 毛片视频免费播放| 国产人妻大战黑人20p| 亚洲一区二区三区黄色| 性生活一级大片| 波多野结衣爱爱视频| 成人午夜剧场视频网站| 国产无套精品一区二区三区| 潮喷失禁大喷水aⅴ无码| 国产又爽又黄无码无遮挡在线观看| 中文字幕乱码在线人视频| 免费看特级毛片| 极品色av影院| 免费中文字幕日韩| 91精品国产闺蜜国产在线闺蜜| 欧美a在线播放| 精品在线观看一区| 欧美日韩色视频| 婷婷在线精品视频| 亚洲国产精品免费在线观看| 日本黄色免费片| 成人在线观看小视频| 欧美特级一级片| 国产成人精品综合久久久久99 | 娇妻高潮浓精白浆xxⅹ| 日韩一区二区三区四区在线| 免费成年人视频在线观看| 九九这里只有精品视频| 丰满少妇中文字幕| 国产a级黄色片| 成人免费无遮挡无码黄漫视频| 少妇光屁股影院| 美国一级黄色录像| 午夜av入18在线| 国产国语老龄妇女a片| 国产精品九九视频| 久久久久亚洲av无码专区桃色| 日韩精品无码一区二区三区久久久| 欧美成人午夜精品免费| 国产3级在线观看| 日韩精品――色哟哟| 亚洲欧美日本一区| 战狼4完整免费观看在线播放版| 国产精品白丝喷水在线观看| 亚洲欧美综合视频| 天堂在线中文视频| 少妇伦子伦精品无吗| 人妻av无码一区二区三区 | 99热这里只有精品4| av电影中文字幕| 成人黄色a级片| 国产69视频在线观看| 黄色av片三级三级三级免费看| 日韩av成人网| 亚洲欧美综合7777色婷婷| youjizz.com国产| 任你操精品视频| 醉酒壮男gay强迫野外xx| 久久国产高清视频| 97人妻精品一区二区免费| 2018天天弄| 亚洲色图日韩精品| 亚洲黄色免费在线观看| 无人码人妻一区二区三区免费| 中文字字幕码一二三区| 国产chinesehd精品露脸| 免费黄色片网站| 一区二区不卡免费视频| 岛国精品一区二区三区| 来吧亚洲综合网| 夫妇交换中文字幕| 波多野结衣av在线免费观看| 日韩大尺度视频| 亚洲性图第一页| 国产波霸爆乳一区二区| 秋霞网一区二区三区| 一级黄色性视频| 受虐m奴xxx在线观看| 在线视频 日韩| 污污免费在线观看| 欧美一区二区三区爽爽爽| 香蕉久久久久久久| 亚洲精品国产熟女久久久| 三叶草欧洲码在线| 中文字幕在线免费看线人| 91丨porny丨对白| 97人妻天天摸天天爽天天| 尤物网站在线观看| 中文在线永久免费观看| 久久久久亚洲AV成人无码国产| 亚洲精品国产成人av在线| 亚洲一区二区三区四区av| 一边摸一边做爽的视频17国产| 国产综合内射日韩久| jizz日本免费| 青青草自拍偷拍| 日本一二三区在线观看| 中文字幕第10页| 中文字幕日韩三级片| www亚洲色图| 永久看片925tv| 日本国产在线视频| 国产毛片欧美毛片久久久| 99成人在线观看| 黄色av电影网站| 亚洲不卡的av| 日本中文在线视频| 免费看毛片的网站| 免费观看a级片| 色欲无码人妻久久精品| 伊人网综合视频| 亚洲AV成人无码精电影在线| 亚洲色婷婷一区二区三区| 亚洲欧美日韩偷拍| 免费黄色激情视频| 好吊一区二区三区视频| 欧美一级特黄高清视频| 亚洲区 欧美区| 久久久久99精品成人| 亚洲自拍偷拍精品| 免费国产羞羞网站美图| 野外性满足hd| 亚洲精品激情视频| 欧美国产日韩在线观看成人| 亚洲第一页av| 丰满少妇xbxb毛片日本| 国产高清视频免费在线观看| 欧洲一级黄色片| 欧美丰满熟妇bbb久久久| 国产精品一区二区亚洲| 欧美亚一区二区三区| youjizz.com日本| 日韩久久久久久久久久久| 内射毛片内射国产夫妻| 中文字字幕码一二三区|