Assignment Task
You are required to build a secure, asynchronous, peer-to-peer chat application. Network communications must via TCP. The flow of the program should be:
- Start the program
- Ask the user for the following information:
- A port on the machine to act for incoming connections
- The name of a file containing a directory of individuals that can be contacted
- Open Server TCP socket locally on port specified by the user
- Load user directory (specification below)
- This is a JSON serialised dictionary format.
- Wait for either an incoming network message or a message to be sent, typed by the user
- If an incoming network message
- Connect to the destination using the secure protocol, which must include
- The generation of key material should be as shown below
- Mutual authentication of the outgoing connection
- Establishment of a secure channel using SHA256 HMAC and AES256 CBC Cryptography
- Receive Message – Message format below.
- Check the control information for consistency
- Display received message to the user
- Terminate Connection
- If message to be sent
- Wait for the message to be completed – Your choice of end indication (special
character, return key, character sequence)
- Request destination from user. This should be selected from the directory, but you
should also provide a manual option to directly specify IP address, port, and password
- Open socket to destination
- Connect to the destination using the secure protocol, which must include
- The generation of key material should be as shown below
- Mutual authentication outgoing connection
- Establishment of a secure channel using SHA256 HMAC and AES256 CBC Cryptography
- Send Message – Message format below.
- Display transmission success or failure message to user
- Terminate Connection
- Go to step 5.
Message Formats
You should use a Python Dictionary message format that can be serialised as follows:
Message = { ‘header’:{
‘msg_type’: type, ‘crc’: val, ‘timestamp’: UTC_val },
‘message’: base64_encoded_text_message, ‘security’:{
‘hmac’: {
‘hmac_type’: val,
‘hmac_val’: val
}, ‘enc_type’: val
} }
User Directory Format
Type of HMAC in use, SHA256
Type of encryption in use, AES256CBC
You should use a Python List of Dictionaries for the directory format, which can be serialised:
Directory = [
{'username': val, 'password': val, 'port': val, 'ip':' val '}, {'username': val, 'password': val, 'port': val, 'ip':' val '}, ...
]
Additional Requirements and Information
Before starting to write your application, plan the way you will develop features
Use the user name in the CHAP messages to select the incoming information for the key.
- Passwords should not be used directly for CHAP, HMAC and crypto keys. Utilising a key derivation function will be rewarded with higher marks
- All messages sent and received should be logged with appropriate security to protect their confidentiality and integrity
- All keys MUST be lower case, i.e. header, msg_type, etc.
- All msg_type values must be lower case
- Where there is no explicit body (ack or nack) the body value is the serialised version of the NoneType or None
- PDUs MUST be serialised as a string and encoded using utf-8
- You may wish to delay the implementation of the user directory functionality to aid simplicity in building the system. Therefore, you may assume only two parties will use this application if this aids or speeds development. However, a user directory is needed for higher marks.
- As a stretch goal, consider implementing confidentiality and integrity in the user directory file, with appropriate crypto material provided on the command line at programme initialisation
- Any messages received out of a time window of 25 seconds should be ignored
- In the Message header use a 32bit Cyclic Redundancy Check calculation from the zlib library
- It is highly recommended that you use an object-oriented approach -- this is not necessary, but higher marks will be awarded for an OO approach.
- You must only use primitive cryptographic libraries and not utilise protocols such as SSL/TLS to provide the security functions.
- It is highly recommended that you use some form of FSM for the management of the communications protocol, this is not necessary, but higher marks will be awarded for an FSM approach.
- Please use comments extensively to explain what your code is doing, and how and why it is doing it.
- Please include a short .txt file that explains any security weakness you think are present in the approach
This It Computer Science has been solved by our PhD Experts at My Uni Paper . Our Assignment Writing Experts are efficient in providing a fresh solution to this question. We are serving more than 10000+ Students in Australia, the UK, and the US by helping them to score HD in their academics. Our Experts are well-trained to follow all marking rubrics and referencing styles.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.