|
1 | | -# crypto-lab-format-ward |
| 1 | +# crypto-lab-format-ward |
| 2 | + |
| 3 | +`FF1 · FF3-1 · AES-256 · Feistel Network` |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Format Ward is a browser-based crypto lab demo for format-preserving encryption (FPE) using FF1 and FF3-1 from NIST SP 800-38G. |
| 8 | + |
| 9 | +The demo shows how sensitive values (credit cards, SSNs, phone numbers, ZIP codes, and custom-alphabet strings) can be encrypted while preserving original format constraints so legacy schema assumptions do not break. |
| 10 | + |
| 11 | +Primary standards references: |
| 12 | + |
| 13 | +- NIST SP 800-38G: https://csrc.nist.gov/pubs/sp/800/38/g/final |
| 14 | +- NIST SP 800-38G Rev.1 (FF3-1): https://csrc.nist.gov/pubs/sp/800/38/g/r1/final |
| 15 | + |
| 16 | +## What You Can Explore |
| 17 | + |
| 18 | +1. Credit Card Tokenization panel |
| 19 | +2. SSN / Phone / Postal format masking panel |
| 20 | +3. FF1 vs FF3-1 side-by-side timing and output comparison |
| 21 | +4. Custom alphabet FF1 encryption and decryption |
| 22 | + |
| 23 | +## Primitives Used |
| 24 | + |
| 25 | +- FF1 (NIST SP 800-38G) |
| 26 | +- FF3-1 (NIST SP 800-38G Rev.1) |
| 27 | +- AES via WebCrypto (`AES-CBC`) as the underlying block primitive |
| 28 | +- Feistel round structure per standard mode definitions |
| 29 | + |
| 30 | +## Running Locally |
| 31 | + |
| 32 | +```bash |
| 33 | +npm install |
| 34 | +npm run dev |
| 35 | +``` |
| 36 | + |
| 37 | +Build and preview: |
| 38 | + |
| 39 | +```bash |
| 40 | +npm run build |
| 41 | +npm run preview |
| 42 | +``` |
| 43 | + |
| 44 | +Run vector checks: |
| 45 | + |
| 46 | +```bash |
| 47 | +npm run test |
| 48 | +``` |
| 49 | + |
| 50 | +## Security Notes |
| 51 | + |
| 52 | +- FF1 is the preferred choice for new deployments in this demo. |
| 53 | +- FF3-1 has known differential-attack literature and reduced margin compared to FF1. |
| 54 | +- The FF3/FF3-1 line of analysis was highlighted by Durak & Vaudenay (2017); this demo surfaces that caveat directly in UI and documentation. |
| 55 | +- Always treat demo code as educational and validate operational choices against your threat model and compliance requirements. |
| 56 | + |
| 57 | +## Why This Matters |
| 58 | + |
| 59 | +Many production systems cannot change field lengths or character constraints without expensive schema and integration rewrites. |
| 60 | + |
| 61 | +FPE allows encryption while preserving the visible format shape, which is useful for tokenization, safe analytics, and controlled data sharing in constrained legacy environments. |
| 62 | + |
| 63 | +## Related Demos |
| 64 | + |
| 65 | +- crypto-compare (Format-Preserving Encryption category): https://github.com/systemslibrarian/crypto-compare |
| 66 | +- crypto-lab landing page: https://github.com/systemslibrarian/crypto-lab |
| 67 | +- crypto-lab-iron-letter: https://github.com/systemslibrarian/crypto-lab-iron-letter |
| 68 | + |
| 69 | +So whether you eat or drink or whatever you do, do it all for the glory of God. — 1 Corinthians 10:31 |
0 commit comments