Skip to content
/ iotsim Public

A simple IoT authentication simulator that demonstrates the BasIoT protocol.

License

Notifications You must be signed in to change notification settings

exprays/iotsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IOTSIM - Secure IoT Authentication Simulator

Overview

IOTSIM is a robust IoT authentication simulator that demonstrates the BasIoT protocol implementation. It provides a comprehensive simulation environment for testing and understanding various IoT security scenarios, including device authentication, secure connections, and potential security threats.

Features

1. Authentication Simulation

  • Legitimate device authentication
  • Hacker attempt simulation
  • Expired request handling
  • Replay attack detection
  • Real-time security monitoring

2. Secure Device Communication

  • Device-to-device secure connection simulation
  • RSA key pair generation
  • Perfect Forward Secrecy with ephemeral keys
  • Challenge-response authentication
  • Visual key matching verification

3. Real-time Monitoring

  • WebSocket-based real-time monitoring
  • Authentication metrics tracking
  • Security event logging
  • Visual representation of system state

4. Visualization Features

  • ASCII art animations for connection states
  • Color-coded status messages
  • Key generation and matching visualization
  • Step-by-step process demonstration

Technical Details

Requirements

  • Go 1.19 or later
  • Gorilla WebSocket package
  • Node.js runtime environment
  • Modern terminal with color support

Installation

  1. Clone the repository:
git clone https://github.com/exprays/iotsim.git
cd iotsim
  1. Install dependencies:
go mod init iotsim
go get github.com/gorilla/websocket
  1. Build the project:
go build
  1. Run the simulator:
./iotsim

or you can just run

go run main.go

Starting the monitor dashboard

1.Make sure you have node.js runtime installed in your machine.

2.Navigate to frontend

cd frontend

3.Install dependencies

npm install

4.Run the node dev server

npm run dev

Usage

Main Menu Options

  1. Legitimate Authentication - Simulate normal device authentication
  2. Hacker Attempt - Test security against unauthorized access
  3. Expired Request - Demonstrate timeout handling
  4. Replay Attack - Show protection against replay attacks
  5. Device Connection - Simulate secure device-to-device communication
  6. Exit - Close the simulator

Example Simulation

# Start the simulator
go run main.go

# Select option 5 for device connection simulation
5

# Watch the secure connection process:
- Key generation
- Public key exchange
- Challenge-response authentication
- Shared secret establishment

Security Features

Authentication Protocol

  • RSA-2048 key pairs for device identity
  • SHA-256 hashing for message integrity
  • Timestamp validation
  • Nonce-based replay protection
  • Digital signatures using PKCS1v15

Device Connection Security

  • Perfect Forward Secrecy
  • Ephemeral key generation
  • Challenge-response verification
  • Secure shared secret establishment
  • Key fingerprint visualization

Architecture

graph TD
    A[Device] -->|Authentication Request| B[Authentication Protocol]
    B --> C[Blockchain Simulator]
    C -->|Verify| D[Resource Holder]
    E[Monitor] -->|WebSocket| F[Real-time Updates]
Loading

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Created by exprays (surya)
  • Inspired by real-world IoT security challenges
  • Built for educational and demonstration purposes

Contact

Disclaimer

This simulator is designed for educational purposes and should not be used as a production security system. While it demonstrates security concepts, it may not implement all necessary security measures for real-world applications. Currently this is in development stage so you can expect bugs🐞!! Email suryakantsubudhi@protonmail.com for bug reports.

About

A simple IoT authentication simulator that demonstrates the BasIoT protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published