A Python-based solution to detect and redact Personally Identifiable Information (PII) from CSV data streams, designed to prevent fraud incidents like those experienced by Flixkart.
detector_dharaneesh_panneerselvam.py- Main PII detection and redaction scriptredacted_output_dharaneesh_panneerselvam.csv- Output file with detected and redacted PIIdeployment_strategy.md- Detailed deployment architecture proposalREADME.md- This documentation
python3 detector_dharaneesh_panneerselvam.py iscp_pii_dataset_-_Sheet1.csv- Phone Numbers: 10-digit numbers
- Aadhar Cards: 12-digit numbers
- Passport Numbers: Format like P1234567
- UPI IDs: username@bank format (paytm, ybl, okaxis, etc.)
- Names: Full names or first+last name combinations
- Email Addresses: Valid email formats
- Physical Addresses: Street + city + pin code
- Device ID/IP Address: Only when combined with user context
- Single first/last names alone
- Standalone email addresses
- Individual city, state, or pin codes
- Transaction/order IDs
- Product descriptions
- Phone: 98XXXXXX10 (preserve first 2 and last 2 digits)
- Aadhar: 12XXXXXXXX12 (preserve first 2 and last 2 digits)
- Passport: PXXXXXX7 (preserve first and last character)
- UPI: usXXX@paytm (preserve first 2 chars and domain)
- Email: [email protected] (preserve first 2 chars and domain)
- Names: JXXX DXXX (preserve first character of each part)
- Address: Replace numbers with X's
- IP: Replace all numbers with XXX