Random Stuff [hide all text]

Research ideas, technology tips, and hacks in the form of gists

Presentation at Espressif DevCon23: Enabling Secure Boot (V2) on ESP32 Platforms in Development and Production

Presentation: MONTGOMERY'S LADDER - Side-channel attacks and defenses on elliptic curve scalar multiplication

Presentation: RSA, ECC, & Pairing-based Cryptography - A Basic Introduction from A Math Perspective

A Random Bytes Generator [show/hide text]

Once upon a time, I worked on a project in which files with random contents and ranging sizes (from 1KB to a few GB) were needed, for testing purposes.

As a not-so-surprising next step, I used the Unix/Linux tool dd to create such files from the entropy source /dev/urandom. It worked fine for the first time. However, when the need came up again, I did find it a little cumbersome to occupy the limited disk space with these "junk" (or not) files, and to move them around when switching between machines. This is the motivation of the following "random bytes generator", which generates a file, on the fly, of a fixed size (in bytes) specified by the user and filled with random bytes, for download.

To generate your random file, put this Perl CGI on your server: randfile.cgi.txt.

Disclaimer: The files generated by this application should NOT be used where "strong randomness" is desired, and therefore in general are not suitable for mission-critical and/or cryptographic applications.

A Step-by-step Guide for PGP/GPG Beginners [show/hide text]

Released by Phil Zimmermann in 1991, Pretty Good Privacy (PGP) is a computer program that supports encryption and digital signing of files. PGP is used by many to secure e-mail communications. PGP is free for personal use, but not open source software. In this guide, we will walk you walk you through the basic, and thus perhaps most important, use cases of an open source alternative to PGP, GNU Privacy Guard (GnuPG, or gpg). Read more...

A Sudoku puzzle solver in Bash [show/hide text]

Just a few days ago I came across an interesting blog column introducing a Sudoku puzzle solver using awk. It reminded me of a Sudoku solver that I wrote a few years ago, out of boredom, in Bash (Bourne-again shell). It uses utilities like `echo', `grep', and `sed', and it runs really slow. I know you can easily do that in a language such as Perl. But who cares if one just wants to kill some time and have some fun?

You can find the script here: Sudoku solver in bash. To use it, put all 81 numbers in the puzzle, from the top row to the bottom with empty cells replaced by zeros, into the first line of a text file, say 'sample_puzzle.txt', and from shell prompt, try
$ ./sudobash sample_puzzle.txt

Example:
$ echo "000381000123000600500007030204006080006000200090100306030800005005003427000045000" > sample_puzzle.txt
$ ./sudobash sample_puzzle.txt
647381592123459678589267134214536789356798241798124356431872965865913427972645813Terminated

Transparent encryption with git [show/hide text]

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes a concern. This article walks you through the procedures of setting up git repositories for which your local working directories are as normal (un-encrypted) but the committed content is encrypted. Read more...