Repository navigation
Build unpassword: zero-knowledge password removal for Google Workspace #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| web: | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: web | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| cache-dependency-path: web/package-lock.json | ||
| - run: npm ci | ||
| - run: npm run lint | ||
| - run: npm run typecheck | ||
| - run: npm test | ||
| - run: npm run build | ||
| - run: npx playwright install --with-deps chromium | ||
| - run: npm run test:e2e | ||
| env: | ||
| CI: 'true' | ||
| - uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: playwright-report | ||
| path: web/test-results | ||
| retention-days: 7 | ||
|
|
||
| site: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| cache-dependency-path: | | ||
| web/package-lock.json | ||
| site/package-lock.json | ||
| - name: Build web app | ||
| working-directory: web | ||
| run: npm ci && npm run build | ||
| - name: Build and check documentation site | ||
| working-directory: site | ||
| run: | | ||
| npm ci | ||
| node build.mjs --out ../_site --app ../web/dist | ||
| node check.mjs --dir ../_site | ||
|
|
||
| gmail-addon: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| - run: node --test gmail-addon/detect.test.mjs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| tags: ['v*'] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| cache-dependency-path: | | ||
| web/package-lock.json | ||
| site/package-lock.json | ||
| - name: Build web app | ||
| working-directory: web | ||
| run: | | ||
| npm ci | ||
| npm test | ||
| npm run build | ||
| env: | ||
| VITE_GOOGLE_CLIENT_ID: ${{ vars.GOOGLE_CLIENT_ID }} | ||
| VITE_GOOGLE_API_KEY: ${{ vars.GOOGLE_API_KEY }} | ||
| VITE_GOOGLE_APP_ID: ${{ vars.GOOGLE_APP_ID }} | ||
| - name: Build documentation site (app under /app/) | ||
| working-directory: site | ||
| run: | | ||
| npm ci | ||
| node build.mjs --out ../_site --app ../web/dist | ||
| node check.mjs --dir ../_site | ||
| - name: Checksums of every published file | ||
| run: node web/scripts/checksums.mjs _site | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: SHA256SUMS | ||
| path: _site/SHA256SUMS.txt | ||
| - uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: _site | ||
|
|
||
| deploy: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - id: deployment | ||
| uses: actions/deploy-pages@v4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| _site | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,105 @@ | ||
| # unpassword | ||
| A Google Workspace app that removes passwords of Office, PDF files and compressed archives for archiving purposes. | ||
|
|
||
| A Google Workspace app that removes the password protection of **Office (DOCX/XLSX/PPTX), PDF files and compressed archives (ZIP)** whose password you already know, for archiving purposes: you can archive them under your own protection (account security, encrypted storage, access policies) instead of a sender's file password. | ||
|
|
||
| **Website and documentation:** <https://nullthrone.github.io/unpassword/>. The web app runs at [`/app/`](https://nullthrone.github.io/unpassword/app/). | ||
|
|
||
| **Zero-knowledge:** decryption and re-saving happen entirely in your browser. There is no backend. The provider of unpassword never receives your files, your passwords or the decrypted content. | ||
|
|
||
| **Not a cracking tool:** unpassword requires the current password. It never guesses, enumerates or bypasses passwords, and it keeps protections that need a password you did not supply. See [Guardrails](#guardrails). | ||
|
|
||
| ## How it works | ||
|
|
||
| ``` | ||
| Browser (static web app) Google | ||
| ┌──────────────────────────────────────┐ ┌───────────────────────────┐ | ||
| │ UI ── Web Worker: qpdf (WASM), │ HTTPS │ Drive API (scope: │ | ||
| │ ECMA-376 Office crypto, zip.js │◄──────►│ drive.file), Picker, OAuth │ | ||
| │ – only place with password and │ └───────────────────────────┘ | ||
| │ plaintext │ ▲ | ||
| └──────────────────────────────────────┘ │ encrypted file only | ||
| Gmail add-on (Apps Script) ── copies the still-encrypted ───────┘ | ||
| attachment to Drive, opens the web app | ||
| ``` | ||
|
|
||
| - **Local mode:** pick or drop a file, enter the password, download the result. No Google sign-in, no Google scripts loaded. | ||
| - **Drive mode:** "Open with → unpassword" in Drive, or "Choose from Google Drive". The result is saved next to the original as `<name> (unlocked).<ext>` (German UI: `(entsperrt)`). Optionally, the encrypted original goes to the trash. | ||
| - **Gmail:** the add-on lists password-protected attachments. "Open in unpassword" stores the *encrypted* attachment in the Drive folder `unpassword – Eingang` and opens the web app on it. | ||
|
|
||
| | Format | Supported protection | Result | | ||
| |---|---|---| | ||
| | PDF | Standard security handler: RC4 40/128, AES-128, AES-256 (R2–R6) | open password removed; see PDF permissions below | | ||
| | DOCX/XLSX/PPTX (and macro variants) | ECMA-376 Agile and Standard encryption | unencrypted OOXML document | | ||
| | ZIP | ZipCrypto, WinZip AES-128/192/256 | unencrypted ZIP with the same entries | | ||
|
|
||
| Not supported: legacy binary Office (.doc/.xls/.ppt), 7z/RAR, certificate-based or DRM protection (Adobe LiveCycle, FileOpen, …), sheet/workbook protection, "read-only recommended". | ||
|
|
||
| ### PDF permissions | ||
|
|
||
| PDFs have two passwords: the open (user) password and the permissions (owner) password. | ||
|
|
||
| | You enter | File | Result | | ||
| |---|---|---| | ||
| | open password | no permission restrictions | fully decrypted | | ||
| | open password | with restrictions (print, copy, …) | open password removed. The **restrictions are kept** (AES-256, empty open password, random owner password that is discarded) | | ||
| | owner password | any | fully decrypted | | ||
| | – | owner password only, no open password | refused: lifting restrictions requires the owner password | | ||
|
|
||
| ## Guardrails | ||
|
|
||
| unpassword is built so that it is useless for attacking files you have no password for: | ||
|
|
||
| - Exactly one typed password per attempt. There are no password lists, imports, generators or "common password" features. The static test `web/tests/guardrails.test.ts` fails if such code appears, including zip.js' password-candidate API. | ||
| - Per-file rate limiting: two free failures, then 5 s, 10 s, 20 s … and a lock after ten failures for the session. | ||
| - No export of hashes, verifiers or salts in any form. | ||
| - Key-derivation parameters (e.g. Office spin counts) are used as stored in the file. | ||
| - Only real encryption is removed with the password that controls it. Permission restrictions, DRM and structure protection are never bypassed. | ||
|
|
||
| These limits run on your machine and are not a cryptographic boundary against a modified copy of the code. They make sure unpassword itself adds no attack capability: a determined attacker gains nothing from it they would not have without it. Details are in [docs/SECURITY.md](docs/SECURITY.md). | ||
|
|
||
| ## Repository layout | ||
|
|
||
| ``` | ||
| web/ static web app (Vite + TypeScript, no UI framework) | ||
| src/core/ format handlers, rate limiter – pure, DOM-free, unit tested | ||
| src/google/ OAuth (GIS), Picker, Drive REST client | ||
| tests/ Vitest unit tests + fixtures | ||
| e2e/ Playwright tests (local mode, Drive mode with mocked APIs, network assertions) | ||
| gmail-addon/ Apps Script Gmail launcher (never decrypts) | ||
| site/ documentation site for GitHub Pages: renders docs/ and the landing page, no JavaScript | ||
| design/ Nullthrone Design System tokens and fonts (self-hosted), the unpassword mark and its PNG renderings | ||
| scripts/ fixture generator, cross-check, brand asset renderer | ||
| docs/ security model, privacy policy, terms, support, imprint, deployment setup | ||
| ``` | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| cd web | ||
| npm ci | ||
| npm run dev # local mode works without any Google configuration | ||
| npm test # unit tests | ||
| npm run test:e2e # Playwright (Chromium) | ||
| npm run lint && npm run typecheck | ||
| npm run build # dist/ + dist/SHA256SUMS.txt | ||
| ``` | ||
|
|
||
| Documentation site: | ||
|
|
||
| ```bash | ||
| cd site && npm ci | ||
| node build.mjs --app ../web/dist # writes ../_site (app under /app/) | ||
| node check.mjs # CSP, no external resources, no broken links | ||
| ``` | ||
|
|
||
| Brand assets (icons, banner, Marketplace screenshots) are rendered by `node scripts/render-brand-assets.mjs` after `npm run build` in `web/`. | ||
|
|
||
| Drive integration needs `VITE_GOOGLE_CLIENT_ID`, `VITE_GOOGLE_API_KEY` and `VITE_GOOGLE_APP_ID` (see [docs/SETUP.md](docs/SETUP.md)). Without them the app runs in local mode only. | ||
|
|
||
| ## Verifying a deployment | ||
|
|
||
| The Pages workflow builds from a tagged commit and publishes `SHA256SUMS.txt` at the site root. Build the same tag locally with the same public Google identifiers and compare the checksums. | ||
|
|
||
| ## License | ||
|
|
||
| MIT, see [LICENSE](LICENSE). Third-party components: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Third-party notices | ||
|
|
||
| unpassword bundles the following components into the web app. | ||
|
|
||
| | Component | License | Use | | ||
| |---|---|---| | ||
| | [qpdf](https://github.com/qpdf/qpdf) via [@neslinesli93/qpdf-wasm](https://github.com/neslinesli93/qpdf-wasm) | Apache-2.0 (qpdf), ISC (WASM packaging) | PDF decryption and re-encryption | | ||
| | [@zip.js/zip.js](https://github.com/gildas-lormeau/zip.js) | BSD-3-Clause | ZIP reading and writing | | ||
| | [cfb](https://github.com/SheetJS/js-cfb) | Apache-2.0 | Compound File Binary parsing (encrypted Office containers) | | ||
| | [@noble/ciphers](https://github.com/paulmillr/noble-ciphers), [@noble/hashes](https://github.com/paulmillr/noble-hashes) | MIT | AES, SHA-1/SHA-2, HMAC for Office decryption | | ||
|
|
||
| The web app and the documentation site additionally include: | ||
|
|
||
| | Component | License | Use | | ||
| |---|---|---| | ||
| | [Jost](https://github.com/indestructible-type/Jost), [Public Sans](https://github.com/uswds/public-sans), [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono) | SIL Open Font License 1.1 (texts in `design/nullthrone/fonts/`) | Typefaces, self-hosted (files taken from Fontsource) | | ||
| | Nullthrone Design System | Nullthrone, used by its owner | Design tokens and brand marks in `design/` | | ||
| | [marked](https://github.com/markedjs/marked) | MIT | Build-time Markdown rendering of the documentation site (not shipped) | | ||
|
|
||
| The test suite additionally contains three sample documents from [msoffcrypto-tool](https://github.com/nolze/msoffcrypto-tool) (MIT): `web/tests/fixtures/office/standard.docx`, `office-agile.docx` and `office-agile.xlsx`. | ||
|
|
||
| The full license texts are in each package's `LICENSE` file in `web/node_modules` after `npm ci`, and at the linked repositories. | ||
|
|
||
| ## Apache-2.0 notice (qpdf) | ||
|
|
||
| qpdf is Copyright (c) 2005–2024 Jay Berkenbilt and contributors, licensed under the Apache License, Version 2.0. You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>. Distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. | ||
|
|
||
| ## Apache-2.0 notice (cfb) | ||
|
|
||
| cfb is Copyright (C) 2013-present SheetJS LLC, licensed under the Apache License, Version 2.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Nullthrone Design System (vendored) | ||
|
|
||
| Tokens and brand assets from the Nullthrone Design System handoff (Claude Design export, 2026-10-04), used by the web app (`web/`) and the documentation site (`site/`). | ||
|
|
||
| - `tokens/colors.css`, `typography.css`, `spacing.css`, `effects.css`, `motion.css` and `base.css` are copied unchanged. | ||
| - `tokens/fonts.css` replaces the original Google Fonts import with self-hosted files in `fonts/` (Jost, Public Sans, JetBrains Mono, all SIL OFL 1.1). unpassword makes no third-party requests for fonts. | ||
| - `assets/nullthrone-mark.svg` and `assets/nullthrone-lockup.svg` are the umbrella brand marks. They fill with `currentColor`. | ||
| - `nullthrone.css` imports everything in the original order. | ||
|
|
||
| ## Rules that matter most | ||
|
|
||
| These are summarised from the design system README. | ||
|
|
||
| - Ink (`--ink-950`) on warm paper (`--paper`). Brass (`--brass-500`) is the single accent, used at most once per view for the primary call to action. | ||
| - Corners are square. Structure comes from 1px hairlines. The double rule (two hairlines 3px apart) marks major section breaks. | ||
| - Display type and uppercase labels use Jost with `--track-caps`. Body text uses Public Sans, code uses JetBrains Mono. | ||
| - Shadows are near-flat. No gradients, no transparency, no blur, no emoji. | ||
| - Dark mode inverts the primitives. It follows the OS preference, and `data-theme` overrides it. | ||
| - Voice: declarative and precise. No hype, no hedging. | ||
|
|
||
| Do not edit the copied token files. Override in the consuming stylesheet instead. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rkm12101988@gmail.com