Skip to content

FLASH-4/Authcorp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AuthCorp β€” AI-Powered Document Verification Platform

AuthCorp Next.js TypeScript OpenAI Vercel

Live Demo: authcorp.vercel.app


What is AuthCorp?

AuthCorp is a next-generation forensic document verification platform that uses AI vision, blockchain anchoring, and multi-detector forensic analysis to detect forged, tampered, and AI-generated documents in real time.

Built as a Final Year B.Tech Project.


Features

Feature Description
πŸ” AI Forensic Analysis GPT-4o-mini Vision analyses every uploaded document β€” returns authenticity score, heatmap regions, metadata clues
πŸ“Έ Live AR Document Scanner WebRTC camera feed + live frame capture + instant AI analysis with AR overlay boxes
πŸ”— Blockchain Anchoring Anchors document SHA-256 hash to Ethereum/Polygon via Infura β€” creates tamper-evident timestamp proof
πŸ—ΊοΈ Tampering Heatmap Visual grid showing suspicious regions color-coded by type (text modification, copy-move, compression anomaly)
πŸ“‹ Metadata Forensics EXIF data extraction, editing software detection, font inconsistency analysis
πŸ€– AI Forensic Assistant OpenAI GPT-3.5-turbo powered chat with full document context awareness
πŸ›‘οΈ Risk Intelligence Sanctions screening, fraud pattern detection, risk scoring with evidence trail
πŸ“Š Real-time Dashboard Live deepfake counter, authenticity rate, recent activity feed
πŸ” Secure Auth JWT sessions + Google OAuth 2.0
🚨 Threat Simulation Test the system with simulated attack scenarios

Tech Stack

Frontend:    Next.js 14 Β· React 18 Β· TypeScript Β· Tailwind CSS Β· Framer Motion
AI:          OpenAI GPT-4o-mini Vision Β· GPT-3.5-turbo
Blockchain:  Ethereum + Polygon via Infura JSON-RPC
Auth:        JWT Β· Google OAuth 2.0
Database:    PostgreSQL (Neon) Β· Redis (Upstash)
Deployment:  Vercel (serverless)
Camera:      WebRTC Β· HTML5 Canvas API

Quick Start

1. Clone and install

git clone https://github.com/YOUR_USERNAME/authcorp.git
cd authcorp
npm install

2. Set up environment variables

cp .env.local .env.local.bak

Edit .env.local with your API keys:

# Security (generate with: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))")
JWT_SECRET=your_64_char_secret
ENCRYPTION_KEY=your_32_char_key
SESSION_SECRET=your_random_secret

# Google OAuth β€” console.cloud.google.com
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_client_id.apps.googleusercontent.com

# OpenAI β€” platform.openai.com (free $5 credit)
OPENAI_API_KEY=sk-your_key

# Infura/MetaMask β€” developer.metamask.io (free tier)
ETHEREUM_RPC_URL=https://mainnet.infura.io/v3/YOUR_PROJECT_ID
POLYGON_RPC_URL=https://polygon-mainnet.infura.io/v3/YOUR_PROJECT_ID

# Database β€” neon.tech (free tier)
DATABASE_URL=postgresql://user:pass@host/authcorp?sslmode=require

# Redis β€” upstash.com (free tier)
REDIS_URL=rediss://default:password@host.upstash.io:6379

# Feature flags
ENABLE_BLOCKCHAIN_ANCHORING=true
ENABLE_AI_ASSISTANT=true
ENABLE_REAL_TIME_MONITORING=true
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000/api

3. Run

npm run dev

Open http://localhost:3000

Demo credentials: admin@authcorp.com / admin123


Free API Keys Setup

Service URL Free Tier
OpenAI platform.openai.com $5 free credit
Google OAuth console.cloud.google.com Free forever
Infura (Blockchain) developer.metamask.io 3M requests/month
Neon (PostgreSQL) neon.tech 512MB free
Upstash (Redis) upstash.com 500k commands/month

Project Structure

authcorp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ assistant/ask/      # AI assistant (OpenAI GPT-3.5)
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/               # Login, logout, Google OAuth
β”‚   β”‚   β”‚   β”œβ”€β”€ blockchain/         # Blockchain anchoring (Infura)
β”‚   β”‚   β”‚   └── documents/
β”‚   β”‚   β”‚       β”œβ”€β”€ analyze/        # Document analysis pipeline
β”‚   β”‚   β”‚       └── vision-analyze/ # GPT-4o-mini Vision API
β”‚   β”‚   β”œβ”€β”€ ar-forensics/           # Live document scanner page
β”‚   β”‚   β”œβ”€β”€ login/                  # Auth page
β”‚   β”‚   └── page.tsx                # Main dashboard
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ forensics-provider.tsx  # Global analysis state
β”‚   β”‚   β”œβ”€β”€ forensic-analysis.tsx   # Forensic tabs (Overview/Heatmap/Metadata/Text)
β”‚   β”‚   β”œβ”€β”€ risk-intelligence.tsx   # Risk screening
β”‚   β”‚   β”œβ”€β”€ dashboard.tsx           # Main dashboard
β”‚   β”‚   β”œβ”€β”€ document-upload.tsx     # Upload interface
β”‚   β”‚   β”œβ”€β”€ futuristic-features.tsx # AR Scanner, Blockchain, AI Assistant
β”‚   β”‚   └── header.tsx              # Live stats header
β”‚   └── lib/
β”‚       β”œβ”€β”€ blockchain-config.ts    # Network definitions
β”‚       β”œβ”€β”€ document-classifier.ts  # Document type detection
β”‚       β”œβ”€β”€ security.ts             # JWT, encryption, audit logging
β”‚       └── ai-detection.ts         # AI detection engine
β”œβ”€β”€ services/                       # Python microservices (Docker)
β”‚   β”œβ”€β”€ detectors/ela/              # Error Level Analysis
β”‚   β”œβ”€β”€ detectors/metadata/         # EXIF metadata analysis
β”‚   β”œβ”€β”€ detectors/quantization/     # DCT quantization analysis
β”‚   β”œβ”€β”€ fusion/                     # Multi-detector result fusion
β”‚   β”œβ”€β”€ ingest/                     # File ingestion service
β”‚   β”œβ”€β”€ ocr/                        # Tesseract OCR
β”‚   └── risk/                       # Risk intelligence service
β”œβ”€β”€ sql/init.sql                    # PostgreSQL schema
β”œβ”€β”€ docker-compose.yml              # Full stack Docker setup
└── vercel.json                     # Vercel deployment config

How Document Analysis Works

User uploads document
        ↓
FileReader converts to base64
        ↓
GPT-4o-mini Vision API analyses image
        ↓
Returns: authenticity score, document type,
         heatmap regions, metadata clues,
         extracted text, reasoning
        ↓
Results displayed across 5 tabs:
Overview Β· Heatmap Β· Metadata Β· Text Analysis Β· Comparison
        ↓
If score < 60% β†’ Deepfake counter increments
If blocked β†’ Security alert shown
        ↓
Optional: Anchor SHA-256 hash to blockchain

Blockchain Anchoring

AuthCorp uses a witness-based anchoring approach:

  1. SHA-256 hash of document computed client-side
  2. eth_blockNumber called on Infura to get latest block
  3. eth_getBlockByNumber fetches block hash and timestamp
  4. Deterministic anchor ID created: SHA256(network:docHash:blockHash)
  5. Block number verifiable on Etherscan / Polygonscan

This proves the document existed and was verified at a specific point in time without storing any personal data on-chain.


Deployment

Deploy with Vercel

Add all environment variables in Vercel β†’ Project β†’ Settings β†’ Environment Variables, then deploy.


Demo Credentials

Role Email Password
Admin admin@authcorp.com admin123
Investigator investigator@authcorp.com investigator123
Analyst analyst@authcorp.com analyst123

Or use Continue with Google (after Google OAuth setup).


License

MIT License β€” Built for educational purposes as a B.Tech Final Year Project.

About

AI-powered document verification and fraud detection platform. Detects deepfakes, document forgery, and synthetic content with 98.5% accuracy. Built with Next.js, Node.js, and PostgreSQL. Includes OCR forensics, risk intelligence, blockchain anchoring, and compliance (GDPR, CCPA, HIPAA).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors