Hey! I'm David, a security engineer at the Blockchain team of Facebook, previously 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.

# NP Complexityposted December 2013

Ahhhh, what is P, NP, NP-Complete and NP-hard. Found this quick explanation. Still reading on the subject. I feel like It might take me a lot of time until I can be able to explain that easily to someone who has no idea what it is.
true mastery of a subject is achieved when you can explain it simply
Here's a stackoverflow pretty simple explanation
A decision problem is in P if there is a known polynomial-time algorithm to get that answer. A decision problem is in NP if there is a known polynomial-time algorithm for a non-deterministic machine to get the answer.
comment on this story

# Canal discret sans mémoireposted November 2013

In my quest to better support to learn, I've again stumbled into a complicated, badly explained and unclear paper from my prof about discreet and time-memoryless channels.

Although it might be just me, but when I don't understand something from one source I like to diversify, and papers from Polytechnique (in french) are always a good snack :

http://www.enseignement.polytechnique.fr/profs/informatique/Nicolas.Sendrier/TI/cours6.pdf comment on this story

# Claude Shannonposted November 2013

Learning about Shannon's theorem in class I got curious and googled the guy.

One extract I found interesting in his wikipedia biography :

Shannon and his wife Betty also used to go on weekends to Las Vegas with M.I.T. mathematician Ed Thorp, and made very successful forays in blackjack using game theory type methods co-developed with fellow Bell Labs associate, physicist John L. Kelly Jr. based on principles of information theory. They made a fortune, as detailed in the book Fortune's Formula by William Poundstone and corroborated by the writings of Elwyn Berlekamp, Kelly's research assistant in 1960 and 1962. Shannon and Thorp also applied the same theory, later known as the Kelly criterion, to the stock market with even better results. Claude Shannon's card count techniques were explained in Bringing Down the House, the best-selling book published in 2003 about the MIT Blackjack Team by Ben Mezrich. In 2008, the book was adapted into a drama film titled 21.

Apart for inventing most of cryptography concepts, and doing chess IA, he also made a fortune from gambling and playing with stocks. Interesting.

comment on this story

# bordeaux1 urlposted November 2013

My portfolio/vitrine/online resume... call it what you want, which is available on davidwong.fr, is now available on david.wong.emi.u-bordeaux1.fr as well. I thought that was pretty cool to have a bordeaux1.fr url. I think I can also have a univ-lyon1.fr since my account is still active but I can't be bothered looking at where it is.

Anyway, just this small piece of news in the ocean of bitcoin/litecoin news I've been posting here. Exams are coming soon and I should blog more about them than cryptocoins but yeah...

comment on this story

# Done!posted November 2013

So after a long night staying up and coding I finally handed in my project including my report in LaTeX.

I'm not really proud of what I did, I felt like I could have done much better if given more time (okay I slacked and I had enough time).

BUT, as I already said earlier, I've accomplished a lot and even though I'm done with this project I still kinda want to keep working on it.

Things that I've learned doing this class :

• C is awful. But now I know the basics. I wish we had one more project to code in C to really get it though.
• Makefile? Headers? I still don't really get the structure of a C project (and I'm ashamed).
• I know Linux! Okay I don't know Linux that much, but I'm getting really causy there. I installed debian on a VM and I'm considering setting up a dual boot on my laptop now.
• Emacs emacs! I was postponing learning it because I was afraid, and just forced myself to use it for this project and goshh am I fast when I use it. When I go back to Sublime Text I just want to C-M-F, C-A, C-K, C-Y...
• LaTeX! As a Math major I've always been ashamed not knowing it. Now that I got a taste of it I'm wondering if I should use it to write my book on.
• Svn and Git. I'm not a stranger anymore! And I use them for all my websites as well now :)

I think that's it, but I feel like I've learned a lot and I wished this course was a year thing rather than a semester thing.

The course is not over yet though and next week we'll dive into java for... a quick swim since it will be our last week.

comment on this story

# I'm turning nutsposted November 2013

I feel like I've been doing a hackaton these past few days trying to finish my sudoku solver. I had to hand it in 2 hours ago but still haven't finished... I really hope this won't affect my grade too much.

I've been learning a lot of Emacs, C, using gcov, gprof, LaTeX... I'm so confused right now and my code has became so dense that it's hard for me to debug it.

Yesterday, suddenly, I found something really stupid in my sudoku grid generation that I couldn't fix. A day after, I found the solution, randomly, fixing it created a huge load of other issues. I have been re-inspecting my whole code all day long and I'm stressed by this deadline that I already passed.

Gosh that is a hard course.

And... because of this, I missed a day writing on my new application. I was on a 9-day strike :(

comment on this story

# What is the enlightenment I'm supposed to attain after studying finite automata? posted November 2013

I'm studying automata, it's sort of a "logical" subject that reminds me of studying mathematics. It looks cool, it only asks your brain to think, not to memorize, and you don't really know what's the real use of it.

If you want to take a peak at what I'm studying, you can find a similar course on Coursera given by Jeff Ullman from Stanford (yes, obviously I should have moved to the US and attend Stanford).

Well, someone nicely asked what I was thinking on Stackoverflow, and someone else nicely answered.

comment on this story

# Réseauxposted November 2013

I have an exam of Réseaux (Network) tomorrow and the slides of my prof are... how could I say this... not really clear. We have practical applications classes but they were... organized in the worst possible way. The subject did seem interesting at first but I felt like I learned nothing. Hopefully for the past few weeks I've been using the wonderful online course An Introduction to Computer Networks given by Nick McKeown and Philip Levis both very competent profs from Stanford. It seems like I should have gone there for my master of Cryptography :) Anyway, I'm doing with what I have here and I feel blessed studying Cryptography right when free online courses started becoming a thing.

The course is available here.

comment on this story

# Sudoku Solverposted November 2013

My Programmmation class first part is about coding a sudoku solver. We have to do everything in english, we have to commit with svn, we have to write a final report with LaTeX.

Every week we're given some vague guidelines and we have to dive deep into C to first, understand what we have to do, and secondly, find solutions in a language we've never really played with before. We have to turn in what we did every week, if our code doesn't compile it's a zero, if it does compile it goes through a multitude of tests that quickly decrease your grade (out of 20). Let's just say I spent many nights and early mornings coding and I started the first week with a 2/20.

It felt like a crash course, it felt unfair at times, but holy cow did I learn some C in a really short amount of time. Props to my professor for that, and I wish I had more courses like that. I might not get the best grade out of this course but I sure learn the most things there.

I've also committed everything I've done on a public git repo so everyone can see how it looks like here :

https://github.com/mimoo/sudoku

You can compile with make, learn how to use with ./sudoku -h

It can read sudokus of different sizes from 1x1 to 64x64 as long as it is presented like this :

#this is a comment

5 3 _ _ 7 _ _ _ _

6 _ _ 1 9 5 _ _ _

_ 9 8 _ _ _ _ 6 _

8 _ _ _ 6 _ _ _ 3

4 _ _ 8 _ 3 _ _ 1

7 _ _ _ 2 _ _ _ 6

_ 6 _ _ _ _ 2 8 _

_ _ _ 4 1 9 _ _ 5

_ _ _ _ 8 _ _ 7 9

# Start of the school yearposted September 2013

time table imported to google cal thanks to hackjack's fabulous application
I have at the moment 5 classes which are all taught in french (I guess because there are not enough foreigners this year), but some of them use english for their slides.

### Programmation

Nothing really new to me, some people coming from the same bachelor as I (mathematics) have difficulties getting to know Linux and programming as a whole for the first time. I'm used to coding so I'm pretty confident (I shouldn't relax too much though). We started on a fast-course on C, GCC, Emacs, SVN... and will move on later with Java. It's taught by Emmanuel Fleury who is a very chill professor, good vibe, very easy to talk to. And the best part is that everything he talks about is online here so if you're interested in the course I'm taking you can have a look there. PS: we're learning a bit of LaTeX AND will have to submit final reports in LaTeX. This is great as I have sought a good occasion to learn it for a while. PS2: I'm using LearnXinYminutes.com to get back into C (haven't coded in C for more than 4 years). It's a great website and I recommend it to you if you want to learn something about any language and already have knowledge in programming.

### Théorie de l'information

Taught by the head of the Cryptology Master, Gilles Zemor, the course seems like an introduction to some of the concepts around Cryptography. Our first classes were about Entropy (which I talked about a bit in the previous post) and easy notions of probability. Here are the professor's notes about the course.

### Arithmétique

The only "real" Math course we have, and I'm a bit surprised since this is a "Mathematics" Master". It's essentially about rings, it's about stuff I already learned. Nothing really captivating at the moment.

### Automates et Complexité

This is one of the most intriguing course, people coming from an IT bachelor seem to have no problem with it. I don't really understand the point of learning this but I like it, it's a lot like Regular Expressions and is about logic more than learning concepts by heart. As a programmer it just seems like funny games to me :) (it might get more difficult very quickly). Note : it's taught by Anca Muscholl.

### Réseaux

The only course I had to choose, but we didn't have much choice since they removed half of the available courses including the one I wanted to take (Probability). The course is taught by... it's a rapid introduction about network concept. I'm not really into it, it speaks too briefly about many things, some are interesting, some are not. I was supposed to have an application class but apparently our professor fell asleep on his way (he's narcoleptic). Overall I was surprised by the absence of real "cryptology courses". But the professors told us they would come very quickly in the second semester, so nothing to worry about. comment on this story

# Here we goposted August 2013

Hey guys, I'm David Wong, a 24 years old french dude who's going to start a Master of Cryptology in the university of Bordeaux 1.

Cryptology (or as Americans like to call it: Cryptography, because we all know they don't care about etymology) is the study of the techniques for secure communications (thanks Wikipedia!), from withdrawing money with a fake credit card to establishing a safe phone conversation between two government officials, it can mean a lot of things... I still have no clue what my future job will be, that's why I had the idea of making this small blog where I could post about my ventures into this new world and, hopefully, being able to take a step back and see what I did, what I liked, what happened in two years of Master (and maybe more).

I've already took Cryptography I given by Dan Boneh from Stanford and I must say I really enjoyed going through his course. Might be one of the most interesting and eloquent teacher I had in my life, and I have never met him. Had a few back and forth mail exchanges with him but sadly, there was no collaboration between our universities. California I'll see you later in life I guess.

I'll also post some thoughts about the new city I'll be moving to : Bordeaux. This is for at least 2 years, or less if I change my mind. Anyway, this is going to be exciting!