I was really confused about all those acronyms when I started digging into OpenSSL and RFCs. So here's a no bullshit quick intro to them.
Or Public-Key Crypto Standard number 7. It's just a guideline, set of rules, on how to send messages, sign messages, etc... There are a bunch of PKCS that tells you exactly how to do stuff using crypto. PKCS#7 is the one who tells you how to sign and encrypt messages using certificates.
If you ever see "pkcs#7 padding", it just refers to the padding explained in pkcs#7.
In a lot of things in the world (I'm being very vague), we use certificates. For example each person can have a certificate, and each person's certificate can be signed by the government certificate. So if you want to verify that this person is really the person he pretends to be, you can check his certificate and check if the government signature on his certificate is valid.
TLS use x509 certificates to authenticate servers. If you go on https://www.facebook.com, you will first check their certificate, see who signed it, checked the signer's certificate, and on and on until you end up with a certificate you can trust. And then! And only then, you will encrypt your session.
So x509 certificates are just objects with the name of the server, the name of who signed his certificate, the signature, etc...
Subject Public Key Info
Public Key Algorithm
Subject Public Key
Issuer Unique Identifier (optional)
Subject Unique Identifier (optional)
Certificate Signature Algorithm
So, how should we write our certificate in a computer format? There are a billion ways of formating a document and if we don't agree on one then we will never be able to ask a computer to parse a x509 certificate.
That's what ASN.1 is for, it tells you exactly how you should write your object/certificate
ASN.1 defines the abstract syntax of information but does not restrict the way the information is encoded. Various ASN.1 encoding rules provide the transfer syntax (a concrete representation) of the data values whose abstract syntax is described in ASN.1.
Now to encode our ASN.1 object we can use a bunch of different encodings specified in ASN.1, the most common one being used in TLS is DER
DER is a TLV kind of encoding, meaning you first write the Tag (for example, "serial number"), and then the Length of the following value, and then the Value (in our example, the serial number).
DER is also more than that:
DER is intended for situations when a unique encoding is needed, such as in cryptography, and ensures that a data structure that needs to be digitally signed produces a unique serialized representation.
So there is only one way to write a DER document, you can't re-order the elements.
This is my second video, after the first explaining how DPA works. I'm still trying to figure out how to do that but I think it is already better than the first one. Here I explain how Coppersmith used LLL, an algorithm to reduce lattices basis, to attack RSA. I also explain how his attack was simplified by Howgrave-Graham, and the following Boneh and Durfee attack simplified by Herrmann and May as well.
So there is this app that encrypts your data on your mobile, in case it ends up in the wrong hands. Sounds good. And then there is this guy who took a look at it and figured out the data was just XORed with a 128bit keys consisting of only 4s. If the data is longer than 128bits? Let's not encrypt it!
I don't know how legit it is, especially considering how easy it is to just write aes(something) but here you go
Some news about the Truecrypt open audit: the report is out.
The TL;DR is that based on this audit, Truecrypt appears to be a relatively well-designed piece of crypto software. The NCC audit found no evidence of deliberate backdoors, or any severe design flaws that will make the software insecure in most instances.
I haven't been posting for a while, and this is because I was busy looking for a place in Chicago. I finally found it! And I just accomplished my first day at Cryptography Services, or rather at Matasano since I'm in their office, or rather at NCC Group since everything must be complicated :D
I arrived and received a bag of swags along with a brand new macbook pro! That's awesome except for the fact that I spent way too much time trying to understand how to properly use it. A few things I've discovered:
you can pipe to pbcopy and use pbpaste to play with the clipboard
open . in the console opens the current directory in Finder (on windows with cygwin I use explorer .)
in the terminal preference: check "use option as meta key" to have all the unix shortcuts in the terminal (alt+b, ctrl+a, etc...)
get homebrew to install all the things
I don't know what I'll be blogging about next, because I can't really disclose the work I'll be doing there. But so far the people have been really nice and welcoming, the projects seem to be amazingly interesting (and yeah, I will be working on OpenSSL!! (the audit is public so that I can say :D)). The city is also amazing and I've been really impressed by the food. Every place, every dish and every bite has been a delight :)
I just discovered Cryptool. I can't believed I didn't know about that earlier.
The CrypTool Portal raises awareness and interest in encryption techniques for everyone.
All learning programs in the CrypTool project are open source and available for free. The CrypTool project develops the world most-widespread free e-learning programs in the area of cryptography and cryptoanalysis.
On their main page (cryptool portal) you have links to: Cryptool 1, Cryptool 2, JCryptool, Cryptool Online and Mystery Twister C3. Each project is a huge amount of information that was gathered by a group of volunteer (so yeah, for free). There are tons of tutorials and ways to play with ciphers to understand them. There is even a coppersmith and boneh-durfee explanation/implementation of the attacks I implemented these last months... This is huge. I feel like I'm just discovering the tip of the iceberg and it's all really confusing so here's a recap of what is everything, for me and for you :)
CrypTool 1 (CT1) was the first version of CrypTool. It was released in 1998 and allows to experiment with different cryptographic algorithms. CT1 runs under Windows. CT1 has two successors: CT2 and JCT.
It doesn't seem like it's useful to dig into this one since CT2 and JCT are supposed to be the updated versions. I've still installed it and it looks really old! But it's super complete and super fast so... still super useful.
CrypTool 2 (CT2) supports visual programming and execution of cascades of cryptographic procedures. CT2 also runs under Windows.
I skimmed through it seeing no resemblance to CT1. I have to spend more time with it but CT1 seemed way more educational and complete...
JCrypTool (JCT) is platform-independent and runs under Linux, Mac and Windows.
Haven't tried it yet but it looks like a multiplatform CT2
CrypTool-Online (CTO) was released in spring 2009. This tool allows to try out different algorithms in a browser / smartphone.
I'm gonna be honest here, not really nice compared to CT1 and CT2. Pretty limited.
Mystery Twister C3
You like riddles? You always loved to solve the crosswords in your newspaper? Or maybe you are just curious and want to find out about some of the ways to hide a secret (and possibily even to uncover it)? This is your place! Here at MysteryTwister C3 you can solve crypto challenges, starting from the simple Caesar cipher all the way to modern AES we have challenges for everyone.
The first riddle is just a sequence a number where you have to guess the last entry. Typical IQ test but it has been solved by 2138 people.
The 29th riddle is Hadstad broadcast attack and had only been solved by 102 people.
There are raffles every month so it might be a nice playground :) play here
I wanted to record myself so I could have put that on youtube along with the slides but... I completely forgot once I got on stage. But this is OK as I got corrected on some points, it will make the new recording better :) I will try to make it as soon as possible and upload it on youtube.
I've watched The Imitation Game recently, a movie about Turing, and I was really disappointed at how they don't explain anything at all. I was also disappointed at how much time they spend drinking or doing something else than doing real work, or how they ended the movie before a potentially interesting second part of Turing's life (Imagine if they showed the persecution, it would have been kind of a Life is beautiful. So anyway, I ran into this explanation of Enigma: