sajjit.soti
← Back to projects

Case study — Final-year cybersecurity thesis

QR-SafeScan: an anti-phishing engine that never has to trust the network

QR codes bridge the physical and digital worlds without a security filter — a malicious sticker over a parking meter bypasses every firewall and email gateway a company owns, because the attack never touches a corporate network. QR-SafeScan is a React Native app built with three teammates at EPITA that catches these “Quishing” attacks before the browser ever loads the page, using 27 on-device heuristics and a stateless threat-intelligence layer that only activates for genuinely ambiguous URLs.

100% / 100%

Precision / recall on validation set

<1.5s

p95 scan-to-verdict time

27

On-device heuristic checks

~95%

Of scans that never leave the device

Built by Sajjit Soti, Yahya Borghol, Yuvaraj Reddy Thimmapuram, and Gatcha Mouhamed Moustapha · advised by Prof. Mohammad Salman Nadeem · EPITA Graduate School of Computer Science, 2026.

01

The problem

A QR code carries no visual signal about where it leads — the browser address bar you’d normally glance at doesn’t exist yet when you scan. That creates what the research calls informational asymmetry: the attacker knows the destination, the victim doesn’t, until it’s too late. The existing options were a false choice between two failure modes:

  • Basic camera scanners — instant, but zero security checks; they just open the link.
  • “Heavy” antivirus scanner apps — real detection, but they log every scan to a cloud account, trading privacy for security.

Nobody was shipping a lightweight scanner that gave real protection withoutsurveilling the user’s scanning habits — that gap is what the thesis set out to close.

02

Architecture: privacy by construction, not by policy

SafeScan runs on a two-tier model. Roughly 90% of the work happens directly on the phone, through React Native’s Hermes JS engine — not because a server was too expensive, but because a server that never receives your data can’t leak it, subpoena it, or get breached with it.

Tier 1 — Local Security Engine

27 heuristic checks run synchronously on the scanned URL string, fully offline. If a check returns a confident verdict — clean or dangerous — the app renders the result immediately, at 0ms network latency, and the URL never leaves the device. This is the “fail fast” path.

Tier 2 — External Intelligence Layer

Only URLs the local engine can’t confidently clear get sent — in parallel — to Google Safe Browsing, VirusTotal, and AlienVault OTX. Results are normalized into a single Safe / Suspicious / Malicious verdict regardless of source format.

The three external sources were each chosen for a specific gap: Google Safe Browsing for speed and the world’s largest phishing blacklist, VirusTotal for depth — a consensus across 70+ antivirus engines, which prevents a single overzealous scanner from producing a false positive — and AlienVault OTX for community-sourced threats that haven’t reached commercial vendors yet.

03

The pivot: when the “correct” architecture was the wrong one

The team didn’t start with this design. The original plan used a centralized Node.js middleware server: client sends the URL, server queries each threat API sequentially, server responds. It looked like the conventional, safe choice. Two weeks in, it failed on both axes the project cared about most:

  • Latency. Sequential API calls (Google → VirusTotal → OTX) pushed scan time past 5 seconds — well beyond the ~2 second threshold at which users abandon a security tool in favor of convenience.
  • Privacy.A central server that every scan passes through is, by definition, a honeypot — exactly the “stateless” promise the thesis was trying to keep.

The fix was architectural, not incremental: move the orchestration client-side and fire the three API calls concurrently with Promise.allSettled. Total wait time drops from the sum of all three calls to just the slowest one — verdict time fell from ~1.76s to ~0.92s, a 48% improvement, and there was no longer a server in the middle to compromise.

// Sequential (legacy): Google (350ms) + VirusTotal (900ms) + OTX (500ms) ≈ 1.76s
// Parallel (SafeScan): max(350ms, 900ms, 500ms) ≈ 0.92s — bounded by the slowest call

const results = await Promise.allSettled([
  checkGoogleSafeBrowsing(url),
  checkVirusTotal(url),
  checkAlienVaultOTX(url),
]);
// A failed/rate-limited API (e.g. VirusTotal's 4 req/min free-tier limit)
// doesn't crash the scan — the other two results still resolve.
04

Four checks from the 27-point local engine

Unlike a blacklist API, the local engine reasons about a URL’s properties — which means it can catch threats it has never seen before.

Typosquatting — Levenshtein distance

Phishers register domains that look almost right — paypa1.com vs paypal.com. SafeScan computes the edit distance against a whitelist of high-value targets; a distance of 1–2 characters (close, but not identical) flags a high-severity typosquatting alert.

for (const legit of LEGITIMATE_DOMAINS) {
  const distance = levenshtein(mainDomain, legitMain);
  if (distance > 0 && distance <= 2 && mainDomain !== legitMain) {
    return { type: "TYPOSQUATTING", severity: "HIGH",
             message: `Possible typosquatting of ${legit}` };
  }
}

Homograph attacks — mixed-script detection

A more sophisticated spoof swaps Latin letters for visually identical Cyrillic or Greek characters — to the eye, аpple.com reads as Apple’s domain, but its Punycode is completely different. A character-by-character lookup table catches the mismatch.

const HOMOGRAPH_CHARS = {
  'a': ['а', 'ɑ', 'α'],  // Cyrillic / Greek visual matches
  'c': ['с', 'ϲ'],
  'e': ['е', 'ė'],
  // ...
};

Shannon entropy — machine-generated domains

Botnet-generated domains (x8z9q2.cn) have far higher character randomness than real words like “facebook” or “nytimes”. Computing the Shannon entropy of the hostname and flagging anything above a 3.5 bit-density threshold catches domain-generation-algorithm (DGA) traffic without any external lookup.

Raw-IP and hex-obfuscated URLs

Legitimate sites almost never ask a user to browse to a bare IP address — it’s a common way to dodge DNS-based blocklists. A regex layer catches IPv4, IPv6, and hex-encoded IP formats (http://0x7f000001) before the app even considers a network call.

Try it yourself

A handful of the 27 real local checks, ported to run in this page — no network call, nothing sent anywhere.

Try:
Paste a URL to scan it
05

From JSON dump to traffic light

The first testable build surfaced raw findings as a JSON object. Beta testers found terms like “Heuristic Match” or “DNS A-Record” intimidating and tapped “Ignore” out of confusion — a real UX failure for a tool whose entire job is to change user behavior in a two-second window. The fix collapsed a three-variable verdict (risk score, API result, heuristic count) into a single, familiar signal:

  • Green — Safe. No heuristics matched, or the API layer confirmed the link is clean.
  • Yellow — Suspicious. A minor signal (e.g. a URL shortener) with no conclusive API result; the user can proceed with a visible warning.
  • Red — Dangerous. >90% confidence (e.g. a VirusTotal positive, or a known phishing pattern). The “Open Link” button is disabled by default to prevent an accidental tap.
06

Three attacks it was built to catch

Restaurant menu

A tabletop QR code leads to a near-perfect fake payment page at paypa1.com. Caught by typosquatting detection before any network call is made.

Parking meter

A sticker over the real code points to a bare IP address. Flagged “Suspicious” by IP-detection, with an explicit warning not to enter payment details.

Zero-day phishing site

A domain registered ten minutes earlier passes local checks and isn’t yet in Google’s blacklist — but VirusTotal’s engine consensus flags it as malicious, and SafeScan surfaces the warning.

07

Verifying the privacy claim, not just asserting it

“Stateless” is an easy word to put in a README and a hard one to prove. The team ran a simulated server-seizure scenario — 100 malicious scans, followed by an audit of runtime memory and server logs. Result: no scanned URLs or IP addresses persisted anywhere after the HTTP transaction closed. Combined with the two-tier design, roughly 95% of real-world scans (the clearly safe or clearly dangerous ones) never generate a network request at all — only the ambiguous ~5% ever reach an external API.

08

Results

MetricSequential (legacy)Parallel (SafeScan)
Total verdict time~1.76s~0.92s (48% faster)
Precision (validation set)100% — no false positives; whitelisted brands stayed clean
Recall (validation set)100% — 24/24 threats caught, including typosquatting variants
Data retained per scan0 (verified via audit)

Tested on a mid-range Android device (Pixel 6a) over standard 4G LTE.

09

How the team worked

Four two-week Agile Action Learning sprints, after an initial Waterfall plan proved too rigid for a problem this exploratory. Security was built into the process, not bolted on afterward: STRIDE threat modeling before writing code, ESLint security plugins catching issues like ReDoS in the validation logic, GitHub Actions running the 112-test unit suite on every pull request, and a probability-vs-impact risk matrix that, for example, anticipated VirusTotal’s 4-requests-per-minute free-tier limit and pre-emptively added a 5-minute local response cache.