Alternative Title: Put a Ring on It: Solving Matrix Equations Over Z/NZ Recently, I implemented the index calculus algorithm for computing discrete logs (i.e. solving a=bx mod N), in order to understand it better. The trickiest part, by far, was figuring out how to solve systems of linear equations modulo N, where N is an arbitrary integer which may not be prime. Web search turned up a number of…
The previous article discussed Bleichenbacher’s 1998 attack on RSA encryption, which relies on access to a PKCS#1v15 padding oracle. Just a few years later, in 2001, James Manger published details of a different padding oracle attack on RSA encryption. Manger’s attack is similar to Bleichenbacher’s attack, but relies on a different type of padding oracle. Manger’s paper is shorter and easier to…
In 1998, Daniel Bleichenbacher published a method for cracking RSA encryption with PKCS#1v15 padding, given access to a “padding oracle”. I learned of this attack via the cryptopals challenges, where it is featured in challenge #47 and #48. The instructions for the challenge state: “We recommend you just use the raw math from the paper and not spend too much time trying to grok how the math…
Today I investigated a performance issue in a client’s Rails application. The problem code was taking about 40 seconds to create and/or update several thousand database records, resulting in HTTP request timeouts. After taking some measurements, reorganizing the code a bit, and applying some standard optimizations, that went down to 8 seconds. A 5× speed boost isn’t bad, and the client would…
The other day I achieved a 25% reduction in load time for a single-page application which requires a large amount of initial data, with just a few lines of added code. If the technique described below seems obvious, well… sorry. I’m writing it down in case it’s interesting to some readers. The web application in question needs many records from a back-end database, which are serialized to JSON and…
(This article is the 4th in a series on differential equations. The previous installments were 1) Understanding the Heat Equation, 2) Understanding the Wave Equation, and 3) Understanding Laplace’s Equation.) The previous article explained the meaning of Laplace’s Equation. We saw a couple examples of equilibrium heat distributions in a piece of heat-conducting material, including this one: Those…
(This article builds on two earlier ones, Understanding the Heat Equation and Understanding the Wave Equation.) Having explored the meanings of the Heat Equation and Wave Equation together with you, I now want to tell you about a third differential equation, also highly significant, and closely connected to the other two: Laplace’s Equation. Here it is: ∇2F=0 In his excellent text Calculus, Gil…
(This article follows on the previous one about lessons from CVE-2024-2757.) After going through the experience of accidentally introducing a denial-of-service vulnerability into PHP (due to an unintentional infinite loop), I adopted a software development practice which I haven’t seen others write about. The short version is: use assertions to ensure that non-trivial loops terminate. The rest of…
In May 2024, for the first time (to my knowledge), a CVE ID was created for a security vulnerability which I accidentally introduced into a high-profile software project. This is it: CVE-2024-2757. I took some scant comfort in the fact that it was a denial-of-service vulnerability and not something worse, such as arbitrary code execution. Even so, this was unpleasant and I don’t wish to repeat the…
My previous article, titled Understanding the Heat Equation, focused on building intuition for this differential equation:[1] ∂t∂F=∂x2∂2F or Ft=Fxx This equally important differential equation is called the Wave Equation: ∂t2∂2F=∂x2∂2F or Ftt=Fxx Don’t the two equations look similar? Well, as might be expected, the extra differentiation on the left-hand side makes the solutions come out…