Profile cover photo
Profile photo
Bjarne Rosengren
489 followers -
Unfocused technology nerd
Unfocused technology nerd

489 followers
About
Bjarne's posts

Post has shared content
I thought I'd write an update on git and SHA1, since the SHA1 collision attack was so prominently in the news.

Quick overview first, with more in-depth explanation below:

(1) First off - the sky isn't falling. There's a big difference between using a cryptographic hash for things like security signing, and using one for generating a "content identifier" for a content-addressable system like git.

(2) Secondly, the nature of this particular SHA1 attack means that it's actually pretty easy to mitigate against, and there's already been two sets of patches posted for that mitigation.

(3) And finally, there's actually a reasonably straightforward transition to some other hash that won't break the world - or even old git repositories.

Anyway, that's the high-level overview, you can stop there unless you are interested in some more details (keyword: "some". If you want more, you should participate in the git mailing list discussions - I'm posting this for the casual git users that might just want to see some random comments).

Anyway, on to the "details":

(1) What's the difference between using a hash for security vs using a hash for object identifiers in source control management?

Both want to use cryptographic hashes, but they want to use them for different reasons.

A hash that is used for security is basically a statement of trust: and if you can fool somebody, you can make them trust you when they really shouldn't. The point of a cryptographic hash there is to basically be the source of trust, so in many ways the hash is supposed to fundamentally protect against people you cannot trust other ways. When such a hash is broken, the whole point of the hash basically goes away.

In contrast, in a project like git, the hash isn't used for "trust". I don't pull on peoples trees because they have a hash of a4d442663580. Our trust is in people, and then we end up having lots of technology measures in place to secure the actual data.

The reason for using a cryptographic hash in a project like git is because it pretty much guarantees that there is no accidental clashes, and it's also a really really good error detection thing. Think of it like "parity on steroids": it's not able to correct for errors, but it's really really good at detecting corrupt data.

Other SCM's have used things like CRC's for error detection, although honestly the most common error handling method in most SCM's tends to be "tough luck, maybe your data is there, maybe it isn't, I don't care".

So in git, the hash is used for de-duplication and error detection, and the "cryptographic" nature is mainly because a cryptographic hash is really good at those things.

I say "mainly", because yes, in git we also end up using the SHA1 when we use "real" cryptography for signing the resulting trees, so the hash does end up being part of a certain chain of trust. So we do take advantage of some of the actual security features of a good cryptographic hash, and so breaking SHA1 does have real downsides for us.

Which gets us to ...

(2) Why is this particular attack fairly easy to mitigate against at least within the context of using SHA1 in git?

There's two parts to this one: one is simply that the attack is not a pre-image attack, but an identical-prefix collision attach. That, in turn, has two big effects on mitigation:

(a) the attacker can't just generate any random collision, but needs to be able to control and generate both the "good" (not really) and the "bad" object.

(b) you can actually detect the signs of the attack in both sides of the collision.

In particular, (a) means that it's really hard to hide the attack in data that is transparent. What do I mean by "transparent"? I mean that you actually see and react to all of the data, rather than having some "blob" of data that acts like a black box, and you only see the end results.

In the pdf examples, the pdf format acted as the "black box", and what you see is the printout which has only a very indirect relationship to the pdf encoding.

But if you use git for source control like in the kernel, the stuff you really care about is source code, which is very much a transparent medium. If somebody inserts random odd generated crud in the middle of your source code, you will absolutely notice.

Similarly, the git internal data structures are actually very transparent too, even if most users might not consider them so. There are places you could try to hide things in (in particular, things like commits that have a NUL character that ends printout in "git log"), but "git fsck" already warns about those kinds of shenanigans.

So fundamentally, if the data you primarily care about is that kind of transparent source code, the attack is pretty limited to begin with. You'll see the attack. It's not silently switching your data under from you.

"But I track pdf files in git, and I might not notice them being replaced under me?"

That's a very valid concern, and you'd want your SCM to help you even with that kind of opaque data where you might not see how people are doing odd things to it behind your back. Which is why the second part of mitigation is that (b): it's fairly trivial to detect the fingerprints of using this attack.

So we already have patches on the git mailing list which will detect when somebody has used this attack to bring down the cost of generating SHA1 collisions. They haven't been merged yet, but the good thing about those mitigation measures is that not everybody needs to even run them: if you host your project on something like http://github.com or kernel.org, it's already sufficient if the hosting place runs the checks every once in a while - you'll get notified if somebody poisoned your well.

And finally, the "yes, git will eventually transition away from SHA1". There's a plan, it doesn't look all that nasty, and you don't even have to convert your repository. There's a lot of details to this, and it will take time, but because of the issues above, it's not like this is a critical "it has to happen now thing".

Post has attachment
Tonight's view..

The white stuff was not there a few hours ago and more is expected to fall.
Photo

Post has shared content
" How do we let Hans Rosling rest in peace?

Perhaps by following his example, and whisper a quick ”thank you” when turning on the water faucet, to get clean, fresh, healthy water."

http://www.sydsvenskan.se/2017-02-13/this-is-how-we-let-hans-rosling-rest-in-peace

Post has attachment
Today's view :-) 
Photo

Post has attachment
Today's view, stadsparken I Lund 
Photo
Photo
2/12/17
2 Photos - View album

Post has attachment
This mornings view. About 10 cm of snow fell during the night and there will probably be more of it .

The pictures are before and after some manual work :)
Photo
Photo
2/8/17
2 Photos - View album

Post has shared content
To be looked at later.
Digital Photography Free Lectures

+Marc Levoy is currently a Principal Engineer at Google and an Emeritus Professor of Computer Science at Stanford University. In Spring of 2016 Marc presented a series of lectures at Google on the subject of Digital Photography and has made these lectures available online for free.

There are a few prerequisites. See first link.

An introduction to the scientific, artistic, and computing aspects of digital photography. Topics include lenses and optics, light and sensors, optical effects in nature, perspective and depth of field, sampling and noise, the camera as a computing platform, image processing and editing, and computational photography. We will also survey the history of photography, look at the work of famous photographers, and talk about composing strong photographs.

This course is based on CS 178 (Digital Photography), which I taught at Stanford from 2009 through 2014. I revised and taught the course again at Google in Spring of 2016, and these web pages are from the Google version. The course consists of 18 lectures. The topics, with dates, are given in the course schedule. The lectures were delivered live on Google's Mountain View campus, broadcast live to Google offices around the world, and recorded for later playback. The videos linked into these web pages are from those recordings, edited slightly to remove discussion of Google internal projects. Keynote slides from these lectures were converted to PDF files and linked into the schedule after each lecture.

I am making these materials freely available, but some of the photographs included in the lectures are individually copyrighted. It should be fine for teachers to re-use this material under fair use, but other uses may be protected. If you re-use the material in substantially the same form it is given here, I would appreciate an acknowledgement.

📖🔗🖼
More here: https://goo.gl/xg6GXl

🎬
Lectures here (YT play list): https://goo.gl/bSgkRZ


📖🔗🖼
He says...

I have retired from Stanford to lead a team at Google. My team is in Google Research, and we work broadly on cameras and photography. One of our projects was burst-mode photography for Project Glass (see also this talk) and HDR+ mode for Nexus and Google Pixel smartphones. The French agency DxO recently gave the Pixel the highest rating ever given to a smartphone camera. Here are some albums of photos I've shot with the Pixel XL: Desolation Wilderness, Cologne and Paris, New York City, Fort Ross and Sonoma County. Press "i" ("Info") for per-picture captions. See also this interview in The Verge, and this SIGGRAPH Asia 2016 paper. My team also worked on underlying technologies for Project Jump, a light field camera that captures stereo panoramic videos for VR headsets such as Google Cardboard. See this May 2015 presentation at Google I/O. Although I am Emeritus, I have been recalled to active to advise my existing students. I will unfortunately not be offering CS 178 (Digital Photography) again at Stanford. However, this course was given at Google in Spring of 2016, and the lectures were recorded for free public distribution. Here is a link. I will also not be taking on any new PhD students, or supervising summer interns. I will hold semi-regular office hours during the academic year, but not during the summer.

Marc Levoy (Stanford): https://goo.gl/p9Rclt

Image: https://goo.gl/QJuUzN from https://goo.gl/sI0JiF

Photo

Post has attachment
Så var det dags för årets första besök på actic 
Photo

Post has attachment
Today's view, måkläppen 
Photo
Wait while more posts are being loaded