Skip to content

Itsmhmod/SecureCoin-Task5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Cash System with Blind Signatures

This project implements a digital cash system similar to Chaum's blind signature scheme, demonstrating how to create, spend, and detect double-spending of digital coins while maintaining user privacy.

Features

  • Blind signature implementation for secure coin creation
  • Double-spending detection
  • Merchant cheating detection
  • Privacy-preserving transactions
  • Identity revelation only for double-spenders

Prerequisites

  • Node.js
  • npm (Node Package Manager)

Installation

  1. Clone the repository
  2. Install dependencies:
npm install blind-signatures

Project Structure

  • driver.js: Main execution file containing the core logic
  • coin.js: Coin class implementation
  • utils.js: Utility functions for cryptographic operations

How It Works

  1. Coin Creation:

    • A user creates a coin with a specific amount
    • The coin contains blinded identity strings (RIS - Reveal Identity String)
    • The bank signs the blinded coin
  2. Transaction Process:

    • User unblinds the signature
    • Merchant verifies the coin's signature
    • Merchant randomly selects left or right half of the identity string
    • Transaction is completed
  3. Security Features:

    • Blind signatures ensure bank can't track coins
    • Double-spending detection reveals cheater's identity
    • Merchant cheating detection prevents RIS reuse

Usage

Run the demo:

node driver.js

Example Output

=== Digital Cash System Demo ===
Creating a new coin...
Created coin for: [User]
Amount: 20 units
Coin ID: [Unique ID]

=== Bank Operations ===
✓ Coin signed and unblinded successfully

=== Merchant Transactions ===
Merchant 1 accepting the coin...
✓ Transaction 1 completed

Merchant 2 accepting the same coin...
✓ Transaction 2 completed

=== Double-Spending Detection Results ===
🚫 ALERT: Double-Spending Detected!
Cheater Identity: [User]

Security Features

  1. Privacy:

    • Regular users remain anonymous
    • Only double-spenders are identified
  2. Anti-Fraud:

    • Double-spending detection
    • Merchant cheating detection
    • Secure blind signatures
  3. Verification:

    • Bank signature verification
    • RIS validation
    • Transaction integrity checks

Technical Details

  • Uses RSA blind signatures
  • Implements one-time pad (OTP) for identity strings
  • SHA-256 hashing for security
  • 2048-bit key length for bank signatures

Contributing

Feel free to submit issues and enhancement requests!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published