GhostPIN is a comprehensive anti-phishing payment verification system that provides cryptographic proof of authenticity between users, merchant pages, and payment gateways. It makes phishing and fake checkout pages cryptographically impossible.
- One-Line SDK Integration: Simple
<script>tag integration for merchants - Visual Nonce Embedding: Steganographic nonce embedding in checkout buttons
- WebAuthn Integration: Face ID, Touch ID, hardware key, and OTP fallback
- Cryptographic Verification: Nonce + page authenticity bound to signed payload
- Real-Time Fraud Analytics: Comprehensive dashboard with fraud detection
- Privacy-First: No biometrics stored, no user tracking
npm installcp .env.example .env
# Edit .env with your configurationnpm run dev- Backend API: http://localhost:3001
- Dashboard: http://localhost:3000
- Health Check: http://localhost:3001/health
GhostPIN/
βββ backend/ # Node.js backend service
β βββ routes/ # API route handlers
β βββ services/ # Business logic
β βββ utils/ # Database and Redis utilities
β βββ server.js # Main server file
βββ sdk/ # Client-side SDK
β βββ ghostpin.js # Main SDK file
βββ dashboard/ # Next.js dashboard
β βββ components/ # React components
β βββ pages/ # Next.js pages
β βββ styles/ # CSS styles
βββ tests/ # Test suites
β βββ verification.test.js
β βββ sdk.test.js
β βββ security.test.js
β βββ integration.test.js
βββ docs/ # Documentation
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=ghostpin
DB_USER=ghostpin
DB_PASSWORD=your_password
# Redis
REDIS_URL=redis://localhost:6379
# Security
JWT_SECRET=your_jwt_secret
ALLOWED_ORIGINS=http://localhost:3000,https://yourdomain.com
# Merchant Configuration
MERCHANT_DEMO_MERCHANT_ORIGIN=https://demo-merchant.com- Register Merchant:
// Add merchant to database
INSERT INTO merchants (merchant_id, name, public_key, origin, active)
VALUES ('your-merchant', 'Your Store', 'your-public-key', 'https://yourstore.com', true);- Configure Environment:
MERCHANT_YOUR_MERCHANT_ORIGIN=https://yourstore.com<!DOCTYPE html>
<html>
<head>
<title>Your Store</title>
</head>
<body>
<!-- Add GhostPIN SDK -->
<script
src="https://cdn.ghostpin.com/ghostpin.js"
data-merchant-id="your-merchant-id"
data-api-url="https://api.ghostpin.com">
</script>
<!-- Your checkout button -->
<button id="checkout-btn" onclick="initiatePayment()">
Pay $99.99
</button>
<script>
async function initiatePayment() {
try {
const result = await window.GhostPIN.verifyPayment({
amount: 9999,
currency: 'USD'
}, {
targetElement: document.getElementById('checkout-btn')
});
if (result.verified) {
// Proceed with payment
processPayment();
} else {
alert('Verification failed: ' + result.reason);
}
} catch (error) {
console.error('GhostPIN error:', error);
}
}
</script>
</body>
</html>// Initialize GhostPIN with custom options
const ghostpin = new GhostPIN({
merchantId: 'your-merchant-id',
apiUrl: 'https://api.ghostpin.com',
fallbackToOTP: true
});
// Listen for events
ghostpin.on('verification', (event) => {
console.log('Verification result:', event.detail);
});
// Custom verification
const result = await ghostpin.verifyPayment({
amount: 5000,
currency: 'USD',
description: 'Premium Plan'
}, {
targetElement: document.getElementById('checkout-btn'),
requireBiometric: true
});- SHA-256 Nonce Generation: Cryptographically secure nonce generation
- WebAuthn Integration: Hardware-backed authentication
- Signature Verification: Cryptographic signature validation
- Replay Attack Prevention: Nonce-based replay protection
- Timestamp Validation: Time-based request validation
- Origin Validation: Domain binding verification
- Rate Limiting: Request rate limiting
- Anomaly Detection: Behavioral pattern analysis
- Real-Time Monitoring: Live fraud detection
- Audit Logging: Comprehensive audit trails
- Verification Statistics: Success/failure rates
- Fraud Alerts: Real-time security alerts
- Domain Analysis: Suspicious domain detection
- Performance Metrics: Response times and throughput
- Hourly Breakdown: Time-based analysis
- Domain Statistics: Origin-based metrics
- Failure Analysis: Error reason tracking
- Risk Scoring: Dynamic risk assessment
npm test# Unit tests
npm run test:unit
# Integration tests
npm run test:integration
# Security tests
npm run test:security
# SDK tests
npm run test:sdknpm run test:coverage# Build Docker image
docker build -t ghostpin .
# Run with Docker Compose
docker-compose up -d- Set up production environment:
export NODE_ENV=production
export DB_HOST=your-db-host
export REDIS_URL=your-redis-url
export JWT_SECRET=your-secure-secret- Deploy backend:
npm run build:backend
npm start- Deploy dashboard:
cd dashboard
npm run build
npm startNODE_ENV=development
DB_HOST=localhost
REDIS_URL=redis://localhost:6379
ALLOWED_ORIGINS=http://localhost:3000NODE_ENV=production
DB_HOST=your-production-db
REDIS_URL=redis://your-redis-cluster
ALLOWED_ORIGINS=https://yourdomain.com- API Health:
GET /health - Database Health: Automatic connection monitoring
- Redis Health: Cache availability monitoring
- Response Times: API performance metrics
- Error Rates: Failure rate tracking
- Throughput: Request volume monitoring
- Fraud Detection: Security metrics
- Structured Logging: JSON-formatted logs
- Audit Trails: Complete verification logs
- Error Tracking: Comprehensive error logging
- Performance Logs: Response time tracking
- HTTPS Only: Enforce HTTPS for all communications
- Domain Validation: Strict origin validation
- Key Management: Secure key storage and rotation
- Rate Limiting: Implement request rate limiting
- Input Validation: Comprehensive input sanitization
- Authentication: JWT-based authentication
- Authorization: Role-based access control
- Encryption: End-to-end encryption
- No Biometric Storage: Biometrics never stored
- Minimal Data Collection: Only necessary data
- Secure Transmission: TLS 1.3 encryption
- Data Retention: Automatic data cleanup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
# Clone repository
git clone https://github.com/your-org/ghostpin.git
cd ghostpin
# Install dependencies
npm install
# Set up development environment
cp .env.example .env
# Edit .env with your configuration
# Start development servers
npm run devThis project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: docs.ghostpin.com
- API Reference: api.ghostpin.com/docs
- Support: support@ghostpin.com
- Issues: GitHub Issues
- β Core SDK implementation
- β Backend verification service
- β Basic dashboard
- β Security testing
- π Advanced fraud detection
- π Machine learning integration
- π Multi-tenant support
- π Mobile SDK
- π Blockchain integration
- π Decentralized verification
- π Cross-platform support
- π Enterprise features
GhostPIN - Making online payments cryptographically secure, one verification at a time.