david wong

Hey! I'm David, cofounder of zkSecurity and the author of the Real-World Cryptography book. I was previously a crypto architect at O(1) Labs (working on the Mina cryptocurrency), before that I was the security lead for Diem (formerly Libra) at Novi (Facebook), and a security consultant for the Cryptography Services of NCC Group. This is my blog about cryptography and security and other related topics that I find interesting.

Quick access to articles on this page:

more on the next page...

How to memorise a 20 item (and upto 1000 item) grocery list. posted March 2015

someone asked on Quora: What can I learn/know right now in 10 minutes that will be useful for the rest of my life?

And someone delivered! It's called the peg method, and it allows you to remember words in the long term really quickly. I knew about other techniques like creating a story where each words is like a double linked list of event or using each words as obstacles in a mental path. But this one seems way more useful and practical. But contrary to the other techniques, you have to memorize a few things before being able to use it:

http://www.quora.com/What-can-I-learn-know-right-now-in-10-minutes-that-will-be-useful-for-the-rest-of-my-life/answer/Jagjot-Cheema

I know it's not cryptography :) but from the header:

This is my blog about cryptography and security and other related topics that I find interesting.

Thanks @Loïs!

comment on this story

Kasumi posted March 2015

kasumi

KASUMI is a block cipher used in UMTS, GSM, and GPRS mobile communications systems. In UMTS, KASUMI is used in the confidentiality (f8) and integrity algorithms (f9) with names UEA1 and UIA1, respectively. In GSM, KASUMI is used in the A5/3 key stream generator and in GPRS in the GEA3 key stream generator.

KASUMI

(and Katsumi/Katsuni is a very famous french porn actress)

comment on this story

Keep in touch with crypto posted February 2015

A long time ago, I think around 2007, I got violently addicted to RSS. I was subscribed to hundreds of different blogs about design, tech, web... One new story would pop in my feed every 5 minutes. I had to read everything and I felt stressed all the time. Clicking, reading, clicking, reading... If I wasn't in front of my computer I felt like I was missing out. I then decided to remove my RSS reader software and never touched a feed again. And for the past years my browsing habits have mostly narrowed down to hackernews and a reddit without any default subs. But now that I am studying crypto, I wanted to get more immersed in this world and I had the idea of using my tendency to get addicted for a good purpose. So I tried the latest recommended RSS readers (since google reader doesn't exist anymore) and I subscribed to every crypto/security blog I could find and I started reading. And since, I've been reading a lot. So I guess it works! I've been using Digg Reader mostly because of the ios app that is really good and also because when I have nothing to read I can dig into what's on my twitter.

I have collected a list of 60 blogs about cryptography and security. If you feel like one is missing or one shouldn't be here please tell me! The list is here

Here's the list if you hate RSS:

2 comments

The ghetto way of extracting the private key of superfish posted February 2015

A realy entertaining piece by Errata Security where Robert Graham ghetto reverse the current controversial superfish of Lenovo.

(if you have been living under a rock

The goal is to set the right break point before it actually infects your machine -- reversers have been known to infect themselves this way.

his ghetto way of reversing is first to infect himself with the "virus" and then using procdump to dump the process memory. Then dumping all the strings that the memory contains with the tool strings and voila. You have have the private certificate in the clear.

But the private certificate is protected by a passphrase. But apparently not, it was just protected by a password contained in the memory in clear as well...

I advise you to read the article, it comes with screenshots and nice commands that use text processing tools:

grep "^[a-z]*$" super.txt | sort | uniq > super.dict

spoiler alert, the password to protect the certificate is komodia the name of the company who created this mitm adware.

Note that if they would have used an RSA whitebox this would not have happened... so quickly.

comment on this story

Big Numbers posted February 2015

An amazing story by Scott Aaronson on Big Numbers.

Keywords: exponential growth, NP-complete problems, Ackermann sequence, Turing Machine, Halting Problem, Busy Beaver,

some quotes :)

In an old joke, two noblemen vie to name the bigger number. The first, after ruminating for hours, triumphantly announces "Eighty-three!" The second, mightily impressed, replies "You win."

Consider, for example, the oft-repeated legend of the Grand Vizier in Persia who invented chess. The King, so the legend goes, was delighted with the new game, and invited the Vizier to name his own reward. The Vizier replied that, being a modest man, he desired only one grain of wheat on the first square of a chessboard, two grains on the second, four on the third, and so on, with twice as many grains on each square as on the last. The innumerate King agreed, not realizing that the total number of grains on all 64 squares would be 264-1, or 18.6 quintillion—equivalent to the world’s present wheat production for 150 years.

Rado called this maximum the Nth "Busy Beaver" number. (Ah yes, the early 1960’s were a more innocent age.)

To solve the Halting Problem for super machines, we’d need an even more powerful machine: a ‘super duper machine.’ And to solve the Halting Problem for super duper machines, we’d need a ‘super duper pooper machine.’

If we could run at 280,000,000 meters per second, there’d be no need for a special theory of relativity: it’d be obvious to everyone that the faster we go, the heavier and squatter we get, and the faster time elapses in the rest of the world. If we could live for 70,000,000 years, there’d be no theory of evolution, and certainly no creationism: we could watch speciation and adaptation with our eyes, instead of painstakingly reconstructing events from fossils and DNA. If we could bake bread at 20,000,000 degrees Kelvin, nuclear fusion would be not the esoteric domain of physicists but ordinary household knowledge.

But do people fear big numbers? Certainly they do. I’ve met people who don’t know the difference between a million and a billion, and don’t care. We play a lottery with ‘six ways to win!,’ overlooking the twenty million ways to lose. We yawn at six billion tons of carbon dioxide released into the atmosphere each year, and speak of ‘sustainable development’ in the jaws of exponential growth.

comment on this story

Using crypto to replace database access. posted February 2015

A pretty fresh article on how you could use crypto to replace a lot of complicated schemes you might use on your website like password reset or mail confirmation:

https://neosmart.net/blog/2015/using-hmac-signatures-to-avoid-database-writes/

tl;dr: instead of creating a table for tokens, you could create the password reset url like this:

http://www.example.com/password_reset/?user=username&expires=15649848949849&[email protected]&token=

and at the place of the token you would put the output of a MAC. Checking the MAC again after receiving the url would confirm that YOU created that url and it has not been modified. Remember, MAC provides integrity and authentication. The author also provides a way to only render this usable once: use the original hashed password as a nonce.

comment on this story