From 796cb7eb085997934cba95132082e169ed5d5a10 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Tue, 6 Jul 2021 16:32:34 -0500 Subject: [PATCH] revamp taxonomies --- config.toml | 4 +++ content/posts/2018-02-01-my-new-life-stack.md | 2 -- .../2018-02-25-cleaning-up-your-shell.md | 5 ++- .../posts/2018-04-23-fixing-tmux-colors.md | 4 +-- content/posts/2018-05-28-web-apps.md | 5 ++- .../2018-10-26-twenty-years-of-rsa-attacks.md | 5 ++- ...2019-02-01-magic-forms-with-proc-macros.md | 5 ++- content/posts/2019-03-04-server-analogy.md | 2 -- content/posts/2020-04-01-password-managers.md | 2 -- content/posts/2021-06-17-tracking-links.md | 4 +-- .../2021-07-05-https-request-from-scratch.md | 35 ++++++++++++++++--- layouts/generic/single.html | 2 ++ layouts/home.html | 8 +++++ layouts/taxonomy/list.html | 21 +++++++++++ 14 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 layouts/taxonomy/list.html diff --git a/config.toml b/config.toml index a54bd50..27a505d 100644 --- a/config.toml +++ b/config.toml @@ -3,6 +3,10 @@ languageCode = "en-us" title = "michael's blog" enableGitInfo = true +[taxonomies] +tag = "tags" +language = "languages" + [markup.tableOfContents] endLevel = 4 ordered = true diff --git a/content/posts/2018-02-01-my-new-life-stack.md b/content/posts/2018-02-01-my-new-life-stack.md index fbf8774..a7cd85b 100644 --- a/content/posts/2018-02-01-my-new-life-stack.md +++ b/content/posts/2018-02-01-my-new-life-stack.md @@ -1,8 +1,6 @@ +++ title = "my new life stack" date = 2018-02-01 - -[taxonomies] tags = ["arch", "linux", "setup", "computers"] +++ diff --git a/content/posts/2018-02-25-cleaning-up-your-shell.md b/content/posts/2018-02-25-cleaning-up-your-shell.md index d3bfd1b..8905c29 100644 --- a/content/posts/2018-02-25-cleaning-up-your-shell.md +++ b/content/posts/2018-02-25-cleaning-up-your-shell.md @@ -1,9 +1,8 @@ +++ title = "cleaning up your shell" date = 2018-02-25 - -[taxonomies] -tags = ["computers", "linux", "bash", "terminal"] +tags = ["computers", "linux", "terminal"] +languages = ["bash"] +++ Is your shell loading slower than it used to? Maybe you've been sticking a bit more into your `.bashrc`/`.zshrc` than you thought. diff --git a/content/posts/2018-04-23-fixing-tmux-colors.md b/content/posts/2018-04-23-fixing-tmux-colors.md index d6f2089..8fd0e1a 100644 --- a/content/posts/2018-04-23-fixing-tmux-colors.md +++ b/content/posts/2018-04-23-fixing-tmux-colors.md @@ -1,9 +1,7 @@ +++ title = "fixing tmux colors" date = 2018-04-23 - -[taxonomies] -tags = ["computers", "terminal"] +tags = ["computers"] +++ Put this in your `~/.tmux.conf`. diff --git a/content/posts/2018-05-28-web-apps.md b/content/posts/2018-05-28-web-apps.md index 79a3dde..932afb2 100644 --- a/content/posts/2018-05-28-web-apps.md +++ b/content/posts/2018-05-28-web-apps.md @@ -1,9 +1,8 @@ +++ title = "web apps" date = 2018-05-28 - -[taxonomies] -tags = ["computers", "javascript", "web-dev", "rant", "things-that-are-bad"] +tags = ["computers", "web", "rant", "things-that-are-bad"] +languages = ["javascript"] +++ The other day, I just turned off JavaScript from my browser. "fucking neckbeard", "you'll turn it back in 2 weeks", "living without JavaScript is like living without electricity" were some of the responses I got. And they might be right. But let's see why things are the way they are and what we can do about it. diff --git a/content/posts/2018-10-26-twenty-years-of-rsa-attacks.md b/content/posts/2018-10-26-twenty-years-of-rsa-attacks.md index 25ff792..4e5c352 100644 --- a/content/posts/2018-10-26-twenty-years-of-rsa-attacks.md +++ b/content/posts/2018-10-26-twenty-years-of-rsa-attacks.md @@ -2,9 +2,8 @@ title = "twenty years of attacks on rsa with examples" date = 2018-10-26 toc = true - -[taxonomies] -tags = ["math", "crypto", "python"] +tags = ["crypto"] +languages = ["python"] +++ ## 1. introduction diff --git a/content/posts/2019-02-01-magic-forms-with-proc-macros.md b/content/posts/2019-02-01-magic-forms-with-proc-macros.md index 6984054..d101437 100644 --- a/content/posts/2019-02-01-magic-forms-with-proc-macros.md +++ b/content/posts/2019-02-01-magic-forms-with-proc-macros.md @@ -1,9 +1,8 @@ +++ title = "magic forms with proc macros: ideas" date = 2019-02-01 - -[taxonomies] -tags = ["computers", "rust", "web-dev", "macros"] +tags = ["computers", "web"] +languages = ["rust"] +++ Procedural macros (proc macros for short) in Rust are incredible because they allow pre-compile source transformation. Many of the greatest abstractions in Rust take advantage of this feature. For example, you can diff --git a/content/posts/2019-03-04-server-analogy.md b/content/posts/2019-03-04-server-analogy.md index 0eff3f8..7d848df 100644 --- a/content/posts/2019-03-04-server-analogy.md +++ b/content/posts/2019-03-04-server-analogy.md @@ -1,8 +1,6 @@ +++ title = "accept server analogy" date = 2019-03-04 - -[taxonomies] tags = ["computers"] +++ diff --git a/content/posts/2020-04-01-password-managers.md b/content/posts/2020-04-01-password-managers.md index 72572e0..43908e6 100644 --- a/content/posts/2020-04-01-password-managers.md +++ b/content/posts/2020-04-01-password-managers.md @@ -1,8 +1,6 @@ +++ title = "password managers" date = 2020-04-01 - -[taxonomies] tags = ["computers", "things-that-are-good", "privacy"] +++ diff --git a/content/posts/2021-06-17-tracking-links.md b/content/posts/2021-06-17-tracking-links.md index 7adb54f..30005da 100644 --- a/content/posts/2021-06-17-tracking-links.md +++ b/content/posts/2021-06-17-tracking-links.md @@ -1,9 +1,7 @@ +++ title = "email tracking links" date = 2021-06-17 - -[taxonomies] -tags = ["email", "computers", "things-that-are-bad", "privacy"] +tags = ["email", "rant", "computers", "things-that-are-bad", "privacy"] +++ You probably get emails every day, and spend a lot of time reading them. And diff --git a/content/posts/2021-07-05-https-request-from-scratch.md b/content/posts/2021-07-05-https-request-from-scratch.md index 92420b0..2447da6 100644 --- a/content/posts/2021-07-05-https-request-from-scratch.md +++ b/content/posts/2021-07-05-https-request-from-scratch.md @@ -3,9 +3,8 @@ title = "sending https requests from scratch" date = 2021-07-05 draft = true toc = true - -[taxonomies] -tags = ["computers", "web", "python"] +tags = ["computers", "web", "crypto"] +languages = ["python"] +++ The web is [so complicated][4] these days, I began wondering exactly how big of a feat it would be to formally verify everything. At this point I realized all I knew about web protocols were from fiddling around with HTTP 1.0 requests from doing CTFs in the past. You'd pop open a socket to wherever you wanted, stick `GET` and then whatever path you wanted, and then add a version number at the end. @@ -394,7 +393,35 @@ print("res", res) ### Encrypted tunnel -Now we should be ready to communicate with the server through our encrypted tunnel. But we forgot to keep around our key negotiation parameters! How will we encrypt our communication? Let's go back and update these functions to let us keep the parameters, and then we can move on to implementing some of these crypto algorithms. +Now we should be ready to communicate with the server through our encrypted tunnel. But we forgot to keep around our key negotiation parameters! How will we encrypt our communication? Let's go back and update these functions to let us keep the parameters, using the crypto functions we just defined. + +The key sharing function: + +```py +def ext_key_share(Q): + kex = b"\x04" + Q.x + Q.y + key_share = struct.pack(">H", 23) + struct.pack(">H", len(kex)) + kex + ext = struct.pack(">H", len(key_share)) + key_share + return (struct.pack(">H", 51) # code number for alpn + + struct.pack(">H", len(ext)) + + ext) +``` + +Finally, the new `client_hello_extensions`: + +```py +def client_hello_extensions(hostname: str): + d, Q = ecdsa_keypair() + data = b"".join([ + ext_supported_versions(), + ext_signature_algorithms(), + ext_supported_groups(), + ext_key_share(Q), + ext_server_name(hostname), + ext_alpn(), + ]) + return (data, d, Q) +``` ## HTTP 2 diff --git a/layouts/generic/single.html b/layouts/generic/single.html index 518d438..50cb9b5 100644 --- a/layouts/generic/single.html +++ b/layouts/generic/single.html @@ -1,5 +1,7 @@ {{- define "content" -}} +hellosu + {{ .Content }} {{- end -}} diff --git a/layouts/home.html b/layouts/home.html index 6180200..b4d726f 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -4,4 +4,12 @@ {{ partial "post-list" $posts }} +
+ + + List of posts by: + [languages] · + [tags] + + {{- end -}} diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html new file mode 100644 index 0000000..fe3546f --- /dev/null +++ b/layouts/taxonomy/list.html @@ -0,0 +1,21 @@ +{{- define "content" -}} + +

{{ .Name }}

+ + + +{{- end -}}