<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>  on phasewalk</title>
    <link>https://blog.phasewalk.xyz/posts/</link>
    <description>Recent content in   on phasewalk</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 29 Apr 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.phasewalk.xyz/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Generating Cryptographic Primes in Rust</title>
      <link>https://blog.phasewalk.xyz/posts/prime-gen/</link>
      <pubDate>Wed, 29 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://blog.phasewalk.xyz/posts/prime-gen/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;This is a &lt;em&gt;draft&lt;/em&gt; post. There may be some rough edges,&#xA;but the core content is here. Feedback is welcome!&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Many cryptographic schemes rely on large prime numbers for their security. RSA needs&#xA;two of them. Diffie-Hellman needs one. DSA, ElGamal, Paillier — primes everywhere.&#xA;Cryptographic libraries need to generate these primes efficiently and securely when&#xA;producing keypairs. In this post, we&amp;rsquo;ll learn how these primes are generated, and&#xA;implement our own in Rust.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Music Engine in $\mathbb{Z}_{12}$</title>
      <link>https://blog.phasewalk.xyz/posts/z12/</link>
      <pubDate>Tue, 21 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://blog.phasewalk.xyz/posts/z12/</guid>
      <description>&lt;p&gt;This project began as a tool for visualizing chord shapes and progressions on a guitar fretboard, while being able to easily switch between different tunings.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s evolving into a more general music engine that can be used to explore various musical concepts, but the initial motivation was to have a tool to help me understand how different tunings work on the guitar.&lt;/p&gt;&#xA;&lt;p&gt;The core insight is that music can be represented using modular&#xA;arithmetic! In particular, the 12 notes in the chromatic scale&#xA;can be represented as elements of the group $\mathbb{Z}_{12}$, which is the integers modulo 12. This allows us to use mathematical operations to manipulate musical concepts like chords and scales.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Discrete Logarithm Problem</title>
      <link>https://blog.phasewalk.xyz/posts/dlp/</link>
      <pubDate>Sun, 12 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://blog.phasewalk.xyz/posts/dlp/</guid>
      <description>&lt;p&gt;The &lt;strong&gt;discrete logarithm problem&lt;/strong&gt; (DLP) is a fundamental problem in group theory that underpins the security of many cryptographic systems, including elliptic curve cryptography and the &lt;a href=&#34;https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange&#34;&gt;Diffie-Hellman key exchange&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In a &lt;a href=&#34;https://blog.phasewalk.xyz/posts/bn254&#34;&gt;cyclic group&lt;/a&gt; $G$ with generator $g$, every element $h\in G$ can be expressed as $h=g^x$ for some integer $x$. Computing $g^x$ given $g$ and $x$ is fast and efficient &amp;ndash; $\mathcal O(\log x)$ using the method of repeated squaring.&lt;/p&gt;&#xA;&lt;p&gt;The inverse problem, however &amp;ndash; given $g$ and $h=g^x$, find $x$ &amp;ndash; is believed to be computationally hard in certain groups. We haven&amp;rsquo;t &lt;em&gt;proven&lt;/em&gt; that it&amp;rsquo;s hard (P vs NP is still an open problem), but we have decades of cryptanalysis and no known efficient algorithms for solving DLP in well-chosen groups, which gives us confidence in its hardness.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DLL Injection</title>
      <link>https://blog.phasewalk.xyz/posts/dll-injection/</link>
      <pubDate>Tue, 11 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://blog.phasewalk.xyz/posts/dll-injection/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://blog.phasewalk.xyz/img/dll-injection.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;DLL Injection is an exploit technique that can be used for anything from harmless game mods to sophisticated malware campaigns. At its core, DLL Injection is about &lt;strong&gt;convincing a running process to execute code it never intended to run&lt;/strong&gt; - whether that&amp;rsquo;s adding custom features to your favorite game, or establishing persistence in a compromised system.&lt;/p&gt;&#xA;&lt;p&gt;As part of my Infosec studies, I decided I would spend today diving deeper into DLLs, and learn about how they can be used to exploit Windows machines.  Here are some of my key takeaways.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cosmos SDK Gas Metering</title>
      <link>https://blog.phasewalk.xyz/posts/cosmos-sdk-gas/</link>
      <pubDate>Tue, 06 Aug 2024 00:00:00 +0000</pubDate>
      <guid>https://blog.phasewalk.xyz/posts/cosmos-sdk-gas/</guid>
      <description>&lt;p&gt;One challenge of implementing &lt;a href=&#34;https://github.com/polymerdao/monomer&#34;&gt;Monomer&lt;/a&gt;&#xA;is creating a standard for how gas is &lt;em&gt;metered&lt;/em&gt; and &lt;em&gt;handled&lt;/em&gt;. By &lt;em&gt;metered&lt;/em&gt; we&#xA;mean both &lt;em&gt;tracked&lt;/em&gt; and &lt;em&gt;calculated&lt;/em&gt;. By &lt;em&gt;handled&lt;/em&gt; we mean how fees are&#xA;&lt;em&gt;checked&lt;/em&gt; and ultimately &lt;em&gt;deducted&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;On the Monomer side, the problem we want to solve is two-fold:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Exempting the first transaction of every block from gas fees&lt;/strong&gt; (the first&#xA;tx in each block are Layer-1 deposits).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Translating the gas limit from the Engine API&amp;rsquo;s &lt;code&gt;PayloadAttributes&lt;/code&gt; to the&#xA;Cosmos SDK&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;To tackle this problem, we need to take a step back and understand how gas is&#xA;handled in the Cosmos SDK; first at a high-level, and then at a more granular&#xA;implementation-level.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
