diff --git a/blogo b/blogo index d013f8a..894c430 100755 Binary files a/blogo and b/blogo differ diff --git a/blogo-input/blogo.json b/blogo-input/blogo.json index a2d78d3..56a4e87 100755 --- a/blogo-input/blogo.json +++ b/blogo-input/blogo.json @@ -1,5 +1,5 @@ { - "title": "arnaucube", + "title": "arnaucube - blog", "relativePath": "/blog", "absoluteUrl": "https://arnaucube.com/blog", "postsDir": "posts", diff --git a/blogo-input/css/style.css b/blogo-input/css/style.css index eabcaeb..ac70688 100644 --- a/blogo-input/css/style.css +++ b/blogo-input/css/style.css @@ -7,6 +7,15 @@ body { font-family: 'Roboto', sans-serif; } +.dark-theme { /* used for body class */ + filter: invert(100%) hue-rotate(180deg); + background-color: #111; +} + +.dark-theme img, .dark-theme video, .dark-theme iframe, .dark-theme .onoffswitch-label, .dark-theme code { + filter: invert(100%) hue-rotate(180deg); +} + a { text-decoration:none!important; } @@ -24,3 +33,45 @@ h1,h2, h3, h4, h5 { padding-top: 20px; } +.postThumb { + color:#000000; + text-decoration:none; +} +.postThumb:hover { + background: #f9f9f9; +} + +/* switch button */ +.onoffswitch { + position: relative; width: 46px; + -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; +} +.onoffswitch-checkbox { + display: none; +} +.onoffswitch-label { + display: block; overflow: hidden; cursor: pointer; + height: 20px; padding: 0; line-height: 20px; + border: 2px solid #FFFFFF; border-radius: 20px; + background-color: #9E9E9E; + transition: background-color 0.3s ease-in; + margin-bottom: 0; +} +.onoffswitch-label:before { + content: ""; + display: block; width: 20px; margin: 0px; + background: #FFFFFF; + position: absolute; top: 0; bottom: 0; + right: 24px; + border: 2px solid #FFFFFF; border-radius: 20px; + transition: all 0.3s ease-in 0s; +} +.onoffswitch-checkbox:checked + .onoffswitch-label { + background-color: #fbc5a0; +} +.onoffswitch-checkbox:checked + .onoffswitch-label, .onoffswitch-checkbox:checked + .onoffswitch-label:before { + border-color: #fbc5a0; +} +.onoffswitch-checkbox:checked + .onoffswitch-label:before { + right: 0px; +} diff --git a/blogo-input/index.html b/blogo-input/index.html index 3c7d5ad..55f207a 100644 --- a/blogo-input/index.html +++ b/blogo-input/index.html @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;">
Blog index - arnaucube.com +
+ arnaucube.com +
+ + +
+
@@ -92,6 +99,33 @@ throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + } diff --git a/blogo-input/postThumbTemplate.html b/blogo-input/postThumbTemplate.html index a4c171f..456a019 100644 --- a/blogo-input/postThumbTemplate.html +++ b/blogo-input/postThumbTemplate.html @@ -1,4 +1,3 @@ -
+
[blogo-index-post-template] -
diff --git a/public/blind-signatures-ec.html b/public/blind-signatures-ec.html index fc7c7cb..efd301c 100644 --- a/public/blind-signatures-ec.html +++ b/public/blind-signatures-ec.html @@ -4,16 +4,16 @@ - Notes on blind signatures over elliptic curves - arnaucube - + Notes on blind signatures over elliptic curves - arnaucube - blog + - + - + @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;">
Blog index - arnaucube.com +
+ arnaucube.com +
+ + +
+
@@ -198,6 +205,33 @@ func main() { throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + } diff --git a/public/blogo.html b/public/blogo.html index e637820..2c3b1ad 100644 --- a/public/blogo.html +++ b/public/blogo.html @@ -4,16 +4,16 @@ - Static blog template engine implementation in Go - arnaucube - + Static blog template engine implementation in Go - arnaucube - blog + - + - + @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;">
Blog index - arnaucube.com +
+ arnaucube.com +
+ + +
+
@@ -445,6 +452,33 @@ func putHTMLToTemplate(template string, m map[string]string) string { throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + } diff --git a/public/coffeeminer-hacking-wifi-cryptocurrency-miner.html b/public/coffeeminer-hacking-wifi-cryptocurrency-miner.html index 493dcd3..b4871e3 100644 --- a/public/coffeeminer-hacking-wifi-cryptocurrency-miner.html +++ b/public/coffeeminer-hacking-wifi-cryptocurrency-miner.html @@ -4,16 +4,16 @@ - CoffeeMiner: Hacking WiFi to inject cryptocurrency miner to HTML requests - arnaucube - + CoffeeMiner: Hacking WiFi to inject cryptocurrency miner to HTML requests - arnaucube - blog + - + - + @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;">
Blog index - arnaucube.com +
+ arnaucube.com +
+ + +
+
@@ -584,6 +591,33 @@ def start(): throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + } diff --git a/public/css/style.css b/public/css/style.css index eabcaeb..ac70688 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -7,6 +7,15 @@ body { font-family: 'Roboto', sans-serif; } +.dark-theme { /* used for body class */ + filter: invert(100%) hue-rotate(180deg); + background-color: #111; +} + +.dark-theme img, .dark-theme video, .dark-theme iframe, .dark-theme .onoffswitch-label, .dark-theme code { + filter: invert(100%) hue-rotate(180deg); +} + a { text-decoration:none!important; } @@ -24,3 +33,45 @@ h1,h2, h3, h4, h5 { padding-top: 20px; } +.postThumb { + color:#000000; + text-decoration:none; +} +.postThumb:hover { + background: #f9f9f9; +} + +/* switch button */ +.onoffswitch { + position: relative; width: 46px; + -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; +} +.onoffswitch-checkbox { + display: none; +} +.onoffswitch-label { + display: block; overflow: hidden; cursor: pointer; + height: 20px; padding: 0; line-height: 20px; + border: 2px solid #FFFFFF; border-radius: 20px; + background-color: #9E9E9E; + transition: background-color 0.3s ease-in; + margin-bottom: 0; +} +.onoffswitch-label:before { + content: ""; + display: block; width: 20px; margin: 0px; + background: #FFFFFF; + position: absolute; top: 0; bottom: 0; + right: 24px; + border: 2px solid #FFFFFF; border-radius: 20px; + transition: all 0.3s ease-in 0s; +} +.onoffswitch-checkbox:checked + .onoffswitch-label { + background-color: #fbc5a0; +} +.onoffswitch-checkbox:checked + .onoffswitch-label, .onoffswitch-checkbox:checked + .onoffswitch-label:before { + border-color: #fbc5a0; +} +.onoffswitch-checkbox:checked + .onoffswitch-label:before { + right: 0px; +} diff --git a/public/flock-botnet.html b/public/flock-botnet.html index 470192c..8774c65 100644 --- a/public/flock-botnet.html +++ b/public/flock-botnet.html @@ -4,16 +4,16 @@ - Auto generated tweets from Markov chains - arnaucube - + Auto generated tweets from Markov chains - arnaucube - blog + - + - + @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;">
Blog index - arnaucube.com +
+ arnaucube.com +
+ + +
+
@@ -370,6 +377,33 @@ throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + } diff --git a/public/index.html b/public/index.html index 0f02745..4ca0e69 100644 --- a/public/index.html +++ b/public/index.html @@ -4,16 +4,16 @@ - arnaucube - + arnaucube - blog + - + - + @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;">
Blog index - arnaucube.com +
+ arnaucube.com +
+ + +
+
@@ -48,54 +55,58 @@
-
+
+

Batch proof in KZG Commitments

+ +

The benefit of batch proof is that allows us to proof multiple points while the proof size remains constant to one $\mathbb{G}_1$ point.

+ +

2021-08-14

+ +
+ +

Notes on KZG polynomial commitments

In the following notes I’ve tried to summarize the KZG Commitments scheme with the concepts that helped me to follow the reasoning.

2021-08-05

-
-
+

Notes on blind signatures over elliptic curves

In this notes, we will cover the scheme proposed at “New Blind Signature Schemes Based on the (Elliptic Curve) Discrete Logarithm Problem” paper by Hamid Mala & Nafiseh Nezhadansari.

2021-07-30

-
-
+

CoffeeMiner: Hacking WiFi to inject cryptocurrency miner to HTML requests

The goal of this post, is to explain how can be done the attack of MITM (Machine-In-The-Middle) to inject some javascript in the html pages, to force all the machines connected to a WiFi network to be mining a cryptocurrency for the attacker.

2018-01-04

-
-
+

Auto generated tweets from Markov chains

Developing a twitter botnet with autonomous bots replying tweets with text generated based on probabilities in Markov chains

2017-12-29

-
-
+

Static blog template engine implementation in Go

How has this blog been made? In this post we will see how to develop a minimalistic static blog template engine with Go.

2017-12-26

-
@@ -142,6 +153,33 @@ throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + } diff --git a/public/kzg-batch-proof.html b/public/kzg-batch-proof.html new file mode 100644 index 0000000..9903d8e --- /dev/null +++ b/public/kzg-batch-proof.html @@ -0,0 +1,196 @@ + + + + + + + Batch proof in KZG Commitments - arnaucube - blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Batch proof in KZG Commitments

+ +

2021-08-14

+ +
+

Warning: I want to state clearly that I’m not a mathematician, I’m just an amateur on math studying in my free time, and this article is just an attempt to try to sort the notes that I took while reading about the KZG Commitments.

+
+ +

Last week I posted some notes on KZG Commitmens, which overviews the scheme for single proofs. The current notes, try to overview the batch proof iteraton on KZG Commitments, and the vector commitment usage of it. Again (as in the previous post), big thanks to Dankrad Feist and Alin Tomescu for their articles which helped me to follow a bit the reasoing behind this, and again, I recommend spending the time reading their articles instead of this current notes.

+ +

Batch proof

+ +

The benefit of batch proof is that allows us to proof multiple points while the proof size remains constant to one $\mathbb{G}_1$ point. +Let $(z_0, y_0), (z_1, y_1), …, (z_k, y_k)$ be the points that we want to proof, and that we have a polynomial $p(x)$ that goes through the points. +The commitment to the polynomial stands the same than for single proofs: $c=[p(\tau)]_1$.

+ +

For the evaluation proof, while in the single proofs we compute $q(x) = \frac{p(x)-y}{x-z}$, we will replace $y$ and $x-z$ by the following two polynomials. +The constant $y$ is replaced by a polynomial that has roots at all the points that we want to prove. This is achieved by computing the Lagrange interpolation for the given set of points:

+ +

$$ +I(x) = \sum_{j=0}^k y_j l_j(x)\newline +where \space\space\space l_j(x) = \prod_{0\leq m \leq k} \frac{x-x_m}{x_j - x_m} +$$

+ +

And the $x-z$, which was to ensure that $q(x)$ had a root at $z$, now, as we want to ensure that $q(x)$ has roots at all the points of the commitment, we will use the zero polynomial: +$$ +Z(x) = \prod_{i=0}^{k} x-z_i =\newline +=(x-z_0)(x-z_1)…(x-z_k) +$$

+ +

This polynomial ensures that when $x=z_i$ ($z_i$ being one of our points), the polynomial evaluation will be zero.

+ +

Now we can put $I(x)$ and $Z(x)$ in place, obtaining $q(x)=\frac{p(x)-I(x)}{Z(x)}$. And the batch proof evaluation is obtained by $\pi=[q(\tau)]_1$.

+ +

The verification is quite similar than what we did for single proofs, but using the mentioned $z(x)$ and $I(x)$: +$$ +\hat{e}(\pi, [Z(\tau)]_2) == \hat{e}(c - [I(\tau)]_1, H) +$$

+ +

Which, as we did with the single proofs in the previous post, we can unroll it and see that: +$$ +\hat{e}(\pi, [Z(\tau)]_2) == \hat{e}(c - [I(\tau)]_1, H)\newline +\Rightarrow \hat{e}([q(\tau)]_1, [Z(\tau)]_2) == \hat{e}([p(\tau)]_1 - [I(\tau)]_1, H)\newline +\Rightarrow [q(\tau) \cdot Z(\tau)]_T == [p(\tau) - I(\tau)]_T +$$ +From where we see that is the equation $q(x)\cdot Z(x)=p(x)-I(x)$, which can be expressed as $q(x) = \frac{p(x) - I(x)}{Z(x)}$, evaluated at $\tau$ from the trusted setup, which is not known: $q(\tau) = \frac{p(\tau) - I(\tau)}{Z(\tau)}$.

+ +

Vector commitments

+ +

As mentioned earlier, this scheme can be used as a vector commitment scheme.

+ +

A vector commitment allows a prover to commit to a vector and later proof that a certain value belongs to that vector. As a traditional example, we can think of Merkle Trees, where we can commit to a vector of values, which are placed in the tree leafs. Then we compute the root which acts as the commitment. Then we can provide a proof that a certain leaf belongs to the vector for the commitment (root) that we showed earlier. +The problem with Merkle Trees is that the proof size grows linearly with the size of the tree, as it contains the siblings from the leaf to the root. Here is where KZG Commitments can be benefitial, as the proof always stands with the same size, one $\mathbb{G}_1$ point, no matter of how many points we are batching.

+ +

We can use KZG Commitments as a vector commitment scheme by mapping the vector as a batch of points that build the polynomial, so when commiting to the polynomial we are commiting to the vector. Then, it’s a matter of using the batch proof approach explained above in order to proof multiple elements of the vector in a single proof that can be verified later.

+ +

Final note

+ +

I’m fascinated by this scheme and its potential. One next rabbit hole (related to KZG Commitments) to look at, would be the Plonk and other similar constructions. Also, another use case that is getting attention in the Ethereum community is the Verkle Trees.

+ +

As in the previous notes, in order to try to put in practice the concepts, I’ve added the batch proof logic at https://github.com/arnaucube/kzg-commitments-study.

+ +
+ + + + + + + + + + + + + + + diff --git a/public/kzg-commitments.html b/public/kzg-commitments.html index e32ec24..169d34d 100644 --- a/public/kzg-commitments.html +++ b/public/kzg-commitments.html @@ -4,16 +4,16 @@ - Notes on KZG polynomial commitments - arnaucube - + Notes on KZG polynomial commitments - arnaucube - blog + - + - + @@ -40,7 +40,14 @@ style="height:50px;font-size:130%;"> @@ -136,7 +143,7 @@ $$

Conclusions

-

The content covered in this notes is just a quick overview, but allows us to see the potential of the scheme. One next iteration from what we’ve seen is the approach to do batch proofs, which allows us to evaluate at multiple points with a single evaluation proof. This scheme can be used as a vector commitment, using a polynomial where the $p(i) = x_i$ for all values of $x_i$ of the vector, which can be obtained from the $x_i$ values and computing the Lagrange interpolation. This is quite useful combined with the mentioned batch proofs.

+

The content covered in this notes is just a quick overview, but allows us to see the potential of the scheme. One next iteration from what we’ve seen is the approach to do batch proofs, which allows us to evaluate at multiple points with a single evaluation proof. This scheme can be used as a vector commitment, using a polynomial where the $p(i) = x_i$ for all values of $x_i$ of the vector, which can be obtained from the $x_i$ values and computing the Lagrange interpolation. This is quite useful combined with the mentioned batch proofs. The batch proofs logic can be found at the blog/kzg-batch-proof notes (kind of the continuation of the current notes).

As a final note, in order to try to digest the notes, I’ve did a toy implementation of this scheme at https://github.com/arnaucube/kzg-commitments-study. It’s quite simple, but contains the logic overviewed in this notes.

@@ -183,6 +190,33 @@ $$

throwOnError : true }); }); + + /// + let theme = localStorage.getItem("theme"); + if ((theme === "light-theme")||(theme==null)) { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } else if (theme === "dark-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + function switchTheme() { + theme = localStorage.getItem("theme"); + if (theme === "light-theme") { + theme = "dark-theme"; + document.getElementById("themeSwitcher").checked = true; + } else { + theme = "light-theme"; + document.getElementById("themeSwitcher").checked = false; + } + document.body.className = theme; + localStorage.setItem("theme", theme); + + console.log(theme); + }