Skip to content

Simulation of a timing covert channel , where a sender transmits a binary message to a receiver and Implementation of Fiestel-based algorithm.

Notifications You must be signed in to change notification settings

navidadkhah/Cyber-Security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Cyber Security Assignments

In this repository, we have three assignments about cyber security and cryptography in the network. Assignments are as follows:

Timing Convert Channel

This project implements a simple timing covert channel using Java's concurrency features. The channel allows for the transmission of binary messages based on different timing intervals, effectively simulating a covert communication mechanism.

Key Concepts

  • Covert Channel: A communication channel that allows information to be communicated in a way that is not intended to be noticed by unauthorized entities.
  • Timing Channel: This specific type of covert channel uses the timing of message transmission to convey information (e.g., longer transmission times for one bit and shorter for another).

Code Explanation

Classes and Structure

  1. TimingConvertChannel: This class implements a blocking channel using a BlockingQueue to ensure thread-safe communication between the sender and receiver.

    • Constructor: Initializes the channel with a fixed size of 1.
    • send(int timingInfo): Sends timing information through the channel. If the channel is full, it blocks until space becomes available.
    • receive(): Receives timing information from the channel. If the channel is empty, it blocks until an item is available.
  2. Sender: Implements the Runnable interface to create a sender thread.

    • run(): Sends a predefined binary message ("1010") bit by bit. It uses different timing intervals to indicate the value of each bit:
      • Bit 1: Sent with a timing of 2 seconds.
      • Bit 0: Sent with a timing of 1 second.
    • Each bit's transmission is simulated by sleeping the thread for the corresponding amount of time.
  3. Receiver: Also implements the Runnable interface to create a receiver thread.

    • run(): Receives timing information for a fixed number of bits (4 in this case) and reconstructs the binary message. The timing information is converted back into bits:
      • Timing of 2 seconds corresponds to Bit 1.
      • Timing of 1 second corresponds to Bit 0.
    • Similar to the sender, the receiver sleeps for the duration of the received timing information to simulate the reception process.
  4. Main Class: This class contains the main method to execute the program.

    • Initializes the TimingConvertChannel.
    • Creates instances of Sender and Receiver.
    • Starts the sender and receiver threads.
    • Waits for both threads to complete using join().

Output

The program will output the sent and received timing information along with the reconstructed binary message, showcasing the operation of the timing covert channel.

Feistel Algorithm

This is a Feistel algorithm but it is not a classic one, it contains some changes. The main process of the algorithm in one round is as below:

The diagram illustrates the structure of the Feistel cipher, highlighting its key components:

  1. Block Division: The input data is divided into two halves, referred to as the left and right blocks. This separation is crucial for the algorithm's operation.

  2. Round Functionality: Each round of the Feistel cipher involves processing one half of the data using a transformation function, known as the F function. This function operates on the right half, combining it with a sub-key derived from the main key.

  3. Key Scheduling: Sub-keys are generated for each round, emphasizing the dynamic aspect of the encryption process. The relationship between the main key and the sub-keys is critical for the cipher's security.

  4. Iterations: The encryption process is repeated for multiple rounds, enhancing security through complex data transformations and non-linear operations.

F function

This function is used for change parts of the string with math operations and help the right part of the string. Tables help us to change the length of the string.

New generating sub-keys

In the algorithm, we change how to create sub-keys. we replace it with the s-box table. in each iteration, we create a specific sub-key that inspired by the previous one and the first sub-key, permutation duo to the original key.

About

Simulation of a timing covert channel , where a sender transmits a binary message to a receiver and Implementation of Fiestel-based algorithm.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published