Skip to content

Jhedie/secret-agent-system

Repository files navigation

secret-agent-system

Description

bugs:

  • server code deletes message if the user is not in the right directory.

  • when in bob, if alice writes a message and attempts login using bob, the server will delete the message since the alice does not have access to bob's directory.

  • work around: check if the user is in the right directory before calling messages from the server.

  • a client with no keys can still access the system in the name of alice and the server will send messages but this would mean the data is removed from the server.

Secret Agent Communication System Checklist

General Overview

  • [] System consists of a Client.java and a Server.java program.

Server Program

  • Named Server.java.
  • Started with the command java Server port.
  • Always running once started.
  • Listens for incoming connections at the specified port.
  • Handles one client connection at a time.
  • Waits for the next request after handling the current one (server never terminates).

Client Program

  • Named Client.java.
  • Started with the command java Client host port userid.
  • Each agent has a unique userid (e.g., alice, bob).
  • Assumes the server's userid is server.
  • Associated with a pair of RSA public and private keys.

RSA Keys

  • Key filenames follow the pattern <userid>.pub or <userid>.prv.
  • Generated by a separate program named RSAKeyGen.java.
  • Server has its own private key and the public keys of all agents.
  • Each agent has their own private key and the public key of the server.
  • Agents do not have the public keys of other agents.
  • Key files must be located in the same folder as the client/server program.
  • Programs must not require keys that they are not supposed to have.

Encryption and Signature

  • Encryption uses RSA/ECB/PKCS1Padding algorithm.
  • Signature uses SHA256withRSA algorithm.
  • Appropriate keys used for encryption and signature as required.

Message Handling

  • Messages encrypted with server's public key by sender.
  • Server decrypts and re-encrypts messages for the recipient.
  • Stored messages kept encrypted on the server.
  • Hashing of userid uses MD5 with "gfhk2024:" prefix.

Communication Protocol

  • Initial server state has no messages.
  • Server only holds messages in memory.
  • Client sends hashed userid to server.
  • Server informs client of message count.
  • Messages signed by server before sending to client.
  • Client verifies signature and decrypts messages.
  • Client prompts for message sending.
  • Encrypted and signed messages sent to server.
  • Server verifies signature and processes messages.

Program Outputs

  • Server prints hashed userid, message sender, and recipient info.
  • Server reports signature verification and decryption failures.
  • Example outputs provided for client and server programs.

Additional Notes

  • No new keys are created or distributed by the client or server programs.
  • Keys are obtained via a separate, unspecified mechanism before execution.
  • No key information is hardcoded in the client or server programs.
  • Check that the right error messages are being printed out.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages