{"id":47300713,"url":"https://github.com/panva/cs24","last_synced_at":"2026-04-01T19:18:22.244Z","repository":{"id":344566674,"uuid":"1181960022","full_name":"panva/CS24","owner":"panva","description":"Cascading Stylesheet 24","archived":false,"fork":false,"pushed_at":"2026-03-15T09:05:57.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-18T14:09:42.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://panva.github.io/CS24/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"panva"}},"created_at":"2026-03-14T21:21:42.000Z","updated_at":"2026-03-16T21:08:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/panva/CS24","commit_stats":null,"previous_names":["panva/cs24"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/panva/CS24","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panva%2FCS24","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panva%2FCS24/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panva%2FCS24/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panva%2FCS24/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panva","download_url":"https://codeload.github.com/panva/CS24/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panva%2FCS24/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31022160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T04:58:43.976Z","status":"ssl_error","status_checked_at":"2026-03-27T04:58:17.966Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-17T01:55:49.564Z","updated_at":"2026-03-27T05:02:23.790Z","avatar_url":"https://github.com/panva.png","language":"CSS","funding_links":["https://github.com/sponsors/panva"],"categories":[],"sub_categories":[],"readme":"# CWS\n\n**CSS Web Signatures — \"digital signatures\" implemented in Pure CSS.**\n\nNo JavaScript. No build step. Just CSS doing things CSS was never meant to do.\n\nSee [`rfc-cs24.txt`](rfc-cs24.txt) for the full specification.\n\n## Algorithm: CS24\n\n**C**ascading **S**tylesheet **24** — a parody of HS256 that computes\nsignatures using nothing but CSS selectors, counters, and counter styles.\n\nThe CS24 signature is `header_constant ⊕ payload ⊕ key`, where the header constant (`0x5C2834`) is derived by XOR-folding the UTF-8 bytes of `{\"alg\":\"CS24\"}` into 3 octets.\n\n```\neyJhbGciOiJDUzI0In0.XXXX.YYYY\n\\_________________/  \\__/  \\__/\n        |              |     |\n   Fixed header     4 chars  4 chars         Total: 29 characters\n   (19 chars)       payload  signature       (CWS Compact Serialization)\n```\n\n### How it works\n\n| Technique | Purpose |\n|---|---|\n| `@counter-style base64url` | Maps 6-bit values (0–63) to the Base64URL alphabet |\n| `@counter-style ascii` | Maps byte values (32–126) to printable ASCII |\n| `counter-increment` on relay `\u003cspan\u003e`s | Accumulates bit weights into counters |\n| `:has()` selectors on `#cws` | Reads checkbox state to conditionally increment counters |\n| XOR via `:has()` pairs | `h⊕p⊕k`: header constant baked into selectors, XOR for h=0 bits, XNOR for h=1 bits |\n| 96 mismatch selectors | Any bit mismatch between computed and entered signature → INVALID |\n| `content: counter(…, base64url)` | Renders live Base64URL output from accumulated counters |\n\n### Stats\n\n- **72** interactive checkboxes (24 payload + 24 key + 24 verification)\n- **48** hidden relay `\u003cspan\u003e` elements for counter accumulation\n- **24** payload encoding rules\n- **24** XOR signature rules (48 selectors)\n- **96** verification mismatch selectors\n- **0** lines of JavaScript\n- **0** bits of security\n\n### Test vector\n\nFrom [Section 11](rfc-cs24.txt) of the RFC:\n\n| | ASCII | Hex | Binary |\n|---|---|---|---|\n| Payload | `Hi!` | `48 69 21` | `01001000 01101001 00100001` |\n| Key | | `AD E6 54` | `10101101 11100110 01010100` |\n| Header constant | | `5C 28 34` | `01011100 00101000 00110100` |\n| **Signature** | | `B9 87 41` | `10111001 10000111 01000001` |\n\nToken: `eyJhbGciOiJDUzI0In0.SGkh.uYdB`\n\n## Usage\n\nOpen `index.html` in a modern browser (Chrome 105+, Firefox 121+, Safari 15.4+).\n\n1. Toggle **payload bits** to encode data as Base64URL\n2. Toggle **key bits** to set your \"secret\" key\n3. The **computed signature** updates live (header ⊕ payload ⊕ key)\n4. Enter signature bits in the **verify** section\n5. If all 24 bits match the computed signature → ✓ VALID\n6. If any single bit differs → ✗ INVALID\n\n## Browser requirements\n\nRequires `:has()` selector support:\n- Chrome/Edge 105+\n- Firefox 121+\n- Safari 15.4+\n\n## Security advisory\n\nCS24 provides exactly **0 bits of security**. The signature algorithm is XOR.\nThe key is visible on screen. The entire algorithm is in a stylesheet.\nDo not use this to protect anything, ever.\n\n## License\n\nMIT — use responsibly (or irresponsibly, given the context).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanva%2Fcs24","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanva%2Fcs24","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanva%2Fcs24/lists"}