Wednesday, May 31, 2017

Counting duplicates in a file.

I've been looking at lightweight hashes. In doing so, I needed a way to look for collisions. I've been using the Solaris 2.6 kernel file as a test target as it is from a 32-bit RISC processor, so it has 32-bit words. First, you convert the kernel into 32-bit words in ASCII.
xxd -c4 -g4 -p unix
I then run scripts that results in unix.hash, and from there, I need to look for collisions.
sort unix.hash | uniq -c | grep -v '^ *1 ' | sort -nr 

Tuesday, May 30, 2017

Makefile: *** missing separator. Stop.

I do not know why you still need tabs in Makefiles.
Makefile:118: *** missing separator.  Stop.
Replaced my spaces to a tab and it suddenly all works.

Sunday, May 28, 2017

Keybase looks like it will not support UTF-8 well.

When I first came across keybase.io, I was excited about the premise of simple key management. I'm a crypto novice, but still, I've seen some terrible crypto implementations.

So what's the problem with keybase? Well, nothing as long as you only speak English. For some reason, it seems that keybase will not let you name devices with utf-8 characters.

I do not believe that the keybase team realized what an annoying bummer that is. I name each of my devices in the language of which I primarily use it. The analogy is that English speakers laugh when you transliterate "Dragon King" into "Long Wang". As young as keybase is as a company and application, I wish they would invest in language support on the front end. Currently, if you want to name a device in Japanese, or French/Spanish with the complete character set, you are out of luck. The proof is in the regex:

var deviceRE = regexp.MustCompile(`^[a-zA-Z0-9][ _'a-zA-Z0-9+-]*$`)
var badDeviceRE = regexp.MustCompile(`  |[ '+_-]$|['+_-][ ]?['+_-]`)

Wednesday, May 24, 2017

Standing on the shoulders of giants.

I write *a lot* of papers. It's my job.
I was asked today what my favorite paper was. My favorite paper will never get any citations and is On the temperature dependence of subthreshold currents in MOS electron inversion layers, revisited. This paper is revisiting the methods data from a 1979 paper entitled On the temperature dependence of subthreshold currents in MOS electron inversion layers by Card and Ulmer.

One might say "it's been done", so why revisit it? Well, because Tsividis cited this work on his seminal paper on CMOS bandgaps and I had never seen similar results. I revisited the data and tested an IC on a modern process, and found that "self aligned" CMOS processes remove the issue they reported.

I tried to contact Card and Ulmer. I found that Card had died, but Ulmer was still alive and was very helpful. I met him in Phoenix after I presented at RFID 2017. We are all building on the work of the people before us. I hope that when I'm 75, some younger mind will take me out for coffee.

Saturday, May 13, 2017

Public-Key encryption, explained as simply as possible.

Over on the wonderful crypto.stackexchange.com, you will find a bunch of mathematicians. When people ask for the most simple example of public-key exchange, you are ultimately sent to either: 1) an overview that does not show you much, nor give an example, or 2) a webpage written by mathematicians, for mathematicians. As I have seen this more than once, I decided that I should try to write the simplest example possible. In order to follow the example, you need to review The simplest example I could come up with is:


Me You


Prime, P = 29,α = 2


secretme = 5 αsecretme = 25 = 32
= x (mod P) = 3 (mod 29)
secretyou = 12 αsecretyou = 212 = 4096
= y (mod P) = 7 (mod 29)


ysecretme = Z (mod P) 75 = Z (mod 29)xsecretyou = Z (mod P) 312 = Z (mod 29)


Z = 16



I'm passing on "Alice and Bob" because I think that it's a terrible notation. In the example above, the prime P, and α are initially shared. The result is "Z", which is calculated between both parties.

Saturday, May 6, 2017

PDF word count

Counting the words in a PDF file is required for journal submission. The FAQ on the site suggested saving the PDF as RTF and then opening it Word. I do not have Word. I use LaTeX. I used the command line in *unix to do:
pdftotext mypaper.pdf - | wc -w
5433 words.