Skip to main content

Selecting random points on a triangle

In this blog post the author explains a couple of ways to choose uniformly a point from a triangle and the first approach that he uses is via the barycentric coordinate: given a triangle identified by the three points \(A\), \(B\) and \(C\)

  1. Generate three random numbers \(\alpha\), \(\beta\) and \(\gamma\) using a uniform distribution from the interval \([0, 1]\)
  2. Normalize the point in such a way that they have sum equal to 1
  3. use \(\alpha A + \beta B + \gamma C\) as the chosen point

The resulting points are not actually uniformly distributed, fact acknowledged by the author itself simply showing a plot of the distribution of the points, my problem is that a plot is not a proof, so this post will try to fix that!

Read more…

Abstract and symbolic execution notes (with possible application on reverse engineering)

This post will be probably a too ambitious one, since I'm going to write about a very theoretical aspect of computation, in particular the so called abstract interpretation: for now let me just say that this field tries to give the best possible answer to unsolvable characterization of computer programs.

Another point of view that I want to address is the use of this kind of analysis with reverse engineering, since a lot of aspects between these two kind of analysis are shared.

This post will have pretty mathematical formalism but should be readable enough also without a PhD.

Read more…

side channels: power analysis

This is a post in a serie regarding side channels, from the theoretical and pratical point of view; the posts are

  • introduction on the model of computing devices (to be finished)
  • using the Chipwhisperer (here)
  • power analysis (this post)
  • glitching (to be finished)

Read more…

Reusing old shit: laptop keyboard

Here we are with another experiment in reusing otherwise trash-destined electronics material; in this episode we are going to refurbish a keyboard, from the recovering of the internal "matrix" to the design of the PCB destined as the controller board, to finally reworking of an existing firmware to create a new USB keyboard.

Read more…

blog migration to Nikola

After running for a couple of years using jekill as a static site generator I decided to switch to nikola for a couple of reasons: first of all because is implemented in python, a language that I know more than ruby and this allows me to improve the platform and customize it more to suite my needs.

Read more…

Reusing old shit: lcd screen

It's happened in the past that someone gifted me of very old (and not working anymore) laptops that otherwise would have been thrown in the garbage; my idea for them was of reusing some parts that are more valuable: battery, disks, keyboards, etc...

Read more…