News for hackers. Stuff that matters.
Re:Introduction to Go 1.1 by drewcoo on Tuesday March 26, 2013 @04:33AM (#5441907)
So I can't tell easily (mea culpa, I'm new to Go) but were the crypto speedups also timing-attack-safe?
Re:Introduction to Go 1.1 by dchest on Tuesday March 26, 2013 @05:55AM (#5442150)
agl (https://news.ycombinator.com/user?id=agl) knows better, as he wrote most crypto in Go, but here's what I know. AES and RC4 in Go standard library are not constant time. AES should be timing safe when used on amd64 CPU with AES instructions. RSA is blinded, but not constant time, and ECC is not constant time (amd64 implementation of curve25519 in go.crypto is constant time, though). The linked hash functions (MD5 and SHA1) shouldn't be used for cryptography, but they and SHA-2 should be safe as there are no loads or branches that depend on secret data.

If you want a timing safe cipher, use (X)Salsa20 from go.crypto repository.

Re:Introduction to Go 1.1 by _ak on Tuesday March 26, 2013 @05:27AM (#5442070)
Can't speak about the speedups per se, but since the standard library has a package with certain operations necessary in crypto implementations to preempt timing attacks, I would say they know what they're doing: http://golang.org/pkg/crypto/subtle/
Re:Introduction to Go 1.1 by laurent123456 on Tuesday March 26, 2013 @05:06AM (#5442000)
Shouldn't that be a property of the algorithm rather than the implementation? I mean as long as they implement the algorithm correctly, do they need to care about being timing-attack-safe?
Re:Introduction to Go 1.1 by arnehormann on Tuesday March 26, 2013 @05:19AM (#5442044)
Yes, they do. Read http://www.imperialviolet.org/2013/02/04/luckythirteen.html - even a division in the cpu may introduce timing differences depending on the input (bottom of the blog post). https://groups.google.com/forum/?fromgroups=#!topic/golang-n... indicates golangs implentation may not be timing attack safe, but that's another version and I don't know for sure.
Re:Introduction to Go 1.1 by pbsd on Tuesday March 26, 2013 @05:19AM (#5442043)
Yes and no. Certain algorithms make it harder to do timing-resistant implementations, but by no means impossible.

Probably the easiest mistake to make is on DH/RSA exponentiation. Using the simple square-and-multiply algorithm gives away plenty of timing data; you usually need to explicitly protect against it by either using blinding or always performing both the square and multiply at each iteration.