News for hackers. Stuff that matters.
Re:A hacker stole $31M of Ether – how it happened, and what ... by pmoriarty on Thursday July 20, 2017 @11:45PM (#14817919)
"smart contracts can also do things that normal contracts can’t, such as enforce a set of rules entirely through unbreakable cryptography."

Isn't "unbreakable" a bit of a dirty word in the security community? Is there really such a thing as "unbreakable cryptography"?

Re:A hacker stole $31M of Ether – how it happened, and what ... by rsync on Friday July 21, 2017 @12:45AM (#14818119)
"Is there really such a thing as "unbreakable cryptography"?"

Yes. One time pads are unbreakable.

"Even after the aliens from Andromeda land with their massive spaceships and undreamed-of computing power, they will not be able to read the Soviet spy messages encrypted with one-time pads (unless they can also go back in time and get the one-time pads)." (Bruce Schneier, Applied Cryptography)

Re:A hacker stole $31M of Ether – how it happened, and what ... by njarboe on Friday July 21, 2017 @01:03AM (#14818185)
One could envision that the transportation of one-time pads as the only objects worth shipping between inhabited solar systems. Value per gram could be enormous.
Re:A hacker stole $31M of Ether – how it happened, and what ... by int_19h on Friday July 21, 2017 @02:47AM (#14818554)
"Our main cargo is a one-time cryptographic pad. The source is Commercial Security at Sjandra Kei; the destination is the certificants' High colony. It was the usual arrangement: We're carrying a one-third xor of the pad. Independent shippers are carrying the others. At the destination, the three parts would be xor'd together. The result could supply a dozen worlds' crypto needs on the Net ..."

- Vernor Vinge, "A Fire upon the Deep"

Re:A hacker stole $31M of Ether – how it happened, and what ... by njarboe on Friday July 21, 2017 @05:02PM (#14823742)
Thanks for the ref. That's where I got it from. Couldn't remember if it was from "A Fire upon the Deep" or from an Ian Banks Culture series book.
Re:A hacker stole $31M of Ether – how it happened, and what ... by Animats on Friday July 21, 2017 @01:00AM (#14818180)
Only if they're really random. See Venona.
Re:A hacker stole $31M of Ether – how it happened, and what ... by bhaak on Friday July 21, 2017 @05:38AM (#14819190)
Are these the same one time pads that have already been cracked by the NSA after the Soviets reused them?
Re:A hacker stole $31M of Ether – how it happened, and what ... by PeterisP on Friday July 21, 2017 @06:47AM (#14819401)
If you reuse them, then it's not a one time pad any more, is it?

Yes, it's well known that two-time pads are very vulnerable in ways that one time pads are not.

Re:A hacker stole $31M of Ether – how it happened, and what ... by bhaak on Friday July 21, 2017 @07:49AM (#14819632)
They are still one time pads, just incorrectly used.

Even if the cryptography is sound, you also need to ensure that no user error can happen.

Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Thursday July 20, 2017 @11:53PM (#14817946)
> Isn't "unbreakable" a bit of a dirty word in the security community

"Dirty" is one way to put it, yes. I'd personally use something like "false god" or "blasphemy" :). "Unbreakable" is a naive way of describing cryptographic algorithms, because it preempts conversations about intractability assertions or complexity analysis...modern cryptography accepts as a premise that "unbreakable" is not a reasonable goal, which is why we work by quantifying computational cost.

When I see someone use the phrase, "unbreakable cryptography", I mentally discount their authority to speak about cryptography and become more skeptical (this also applies to people who write things like "bank-grade security" or who tell me "AES-256" when I ask them how they're encrypting data, as if the key size is more important than the block cipher mode or confidentiality/authentication construction).

> Is there really such a thing as "unbreakable cryptography"?

A one-time pad, with the following provisos:

1. It has a truly random seed, not a pseudorandom one;

2. It is at least as long as the plaintext;

3. It is never reused (for the same plaintext, in whole or part).

It's straightforward to see why this guarantees information-theoretic security - you have no way of knowing when you've recovered the correct plaintext. There's nothing to brute-force.

In the security community we don't use one-time pads because we dare not touch the sun: they are extremely difficult to implement correctly, and even if you do implement them correctly you have traded off an inordinate amount of practical usability for a relatively small improvement in information theoretic security.

Asking people to 1) use true randomness to seed keys, 2) generate a new secret key for every message, 3) never reuse the same secret key and 4) keep each secret key securely confidential is extremely prone to error. It's often a fetishized ideal among people who first read about it, but in practice it's just not worth it.

Re:A hacker stole $31M of Ether – how it happened, and what ... by Animats on Friday July 21, 2017 @01:07AM (#14818195)
Those are not sufficient conditions for a one-time pad. The entire pad, not just some "seed" has to be random. The pad cannot ever be reused even with a different plaintext. Breaking a one-time pad that's been used twice is not very hard. It's equivalent to recovering two texts which have been XORed together, which is not hard for English.

One time pad systems are used regularly for high-security embassy-to-State Department communications. Since there are also secure couriers between those locations, there's a way to distribute key material. With today's storage densities, carrying key material around is easy.

Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @08:56AM (#14820063)
> Those are not sufficient conditions for a one-time pad. The entire pad, not just some "seed" has to be random.

Well that seems a bit pedantic, but yes, you're right. The difficulty I was focusing on however is the randomness itself, not how far it has to be extended. Ostensibly once you've incorporated a non-deterministic seed (which is necessarily external) into your process, you can extend it to the pad itself. The pad itself will just be a stream of that data, like a non-deterministic stream cipher. I get the impression you're aware of this already though, so I won't belabor it.

> One time pad systems are used regularly for high-security embassy-to-State Department communications. Since there are also secure couriers between those locations, there's a way to distribute key material. With today's storage densities, carrying key material around is easy.

Fair enough, I'll concede they have practical uses in situations where there are couriers and extremely high security requirements. That's about all they're practical for, though :)

Re:A hacker stole $31M of Ether – how it happened, and what ... by tptacek on Friday July 21, 2017 @11:12AM (#14821155)
I'm not sure I follow this, but if you're "extending" randomness from an externally-provided "seed" of random data, what you're doing is encrypting with a stream cipher, not a one-time pad.

I might be just misunderstanding you though.

Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @11:58AM (#14821524)
Yeah that's a comparison I drew down-thread as well (w/r/t a stream cipher). "Seed" was a poor choice of terminology on my part there - the point I was trying to convey is that you'll need a non-deterministic source, which is necessarily outside of software. I used the term "seed" as a shorthand for that (as if it were a stream cipher), but strictly speaking as you say that's not correct, as you'll be taking the random data directly as a key.

So no, you're not misunderstanding - I just communicated poorly!

Re:A hacker stole $31M of Ether – how it happened, and what ... by kierenj on Friday July 21, 2017 @04:45AM (#14819011)
I don't understand how this is practical. If you have a highly secure mechanism for distributing the ultimate secret - one-time-pads - why not just distribute the messages in this way?

Is it just the fact that it would take two trips for the courier? Or that someone would need to intercept both communications (pad, ciphertext)?

Re:A hacker stole $31M of Ether – how it happened, and what ... by PeterisP on Friday July 21, 2017 @06:49AM (#14819410)
A big benefit is that you can time-shift the distribution of the secret - you can distribute the one-time pad when it's convenient (e.g. when your submarine is at a home port) and be able to send secure messages over insecure channels at any future time.
Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @09:00AM (#14820098)
Yes, this is essentially half the basis for cryptography, of which the one-time pad is one particularly rigid form. If Alice and Bob wish to communicate, they can do so by first verifying each other in person, or with a trusted courier, and from then on can communicate remotely. Alternatively, they can use public-key cryptography to communicate remotely and securely over an insecure channel without requiring face to face contact or a trusted courier.
Re:A hacker stole $31M of Ether – how it happened, and what ... by sbierwagen on Friday July 21, 2017 @08:06PM (#14824652)
An important note: public key cryptography allows secure communication over insecure channels, where an adversary only has the ability to listen in, but not over untrusted channels, where an adversary can actively intercept messages and edit them.

The internet is an untrusted medium, since packet switching requires packets to travel through routers that can edit them at will. (The fabled man in the middle attack) This is the whole point of the certificate issuer public-key infrastructure, where issuer public keys are included in your OS's installation files, a secure communication channel. (If you can't trust your OS, you of course can't trust any communication made with it to be secure anyway)

Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @08:22PM (#14824710)
That's a good note - more succinctly, the key exchange can provide confidentiality, but not authentication.
Re:A hacker stole $31M of Ether – how it happened, and what ... by j08ny on Friday July 21, 2017 @05:29AM (#14819166)
It's not practical for most cases, but the few very very high-security ones. The pads are distributed beforehand, stored securely and used when a message encrypted to them comes in. So it's just that the message can have OTP security while not taking the time of a courier trip and can be just sent on other somewhat insecure channel.
Re:A hacker stole $31M of Ether – how it happened, and what ... by cbhl on Thursday July 20, 2017 @11:57PM (#14817960)
One thing I've never understood about the one-time pad:

How do you guarantee the third condition? Wouldn't you eventually run into the birthday problem if you sent enough messages?

Re:A hacker stole $31M of Ether – how it happened, and what ... by jaibot on Friday July 21, 2017 @12:08AM (#14817999)
Yes, so the rule is slightly misstated. Assuming that your messages are all under n bits and you always use an n-length pad, you will reuse the same pad approximately once every 2^n messages. Not coincidentally, 2^n is also the number of possible one-time pads there are, so your adversary gains no information from this fact.
Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @12:33AM (#14818082)
> Not coincidentally, 2^n is also the number of possible one-time pads there are, so your adversary gains no information from this fact.

Yes! And this is what's critical to the success of the one-time pad: you've not just encrypted data, you've encrypted data in such a fashion that (from the attacker's perspective), all plaintexts they recover are equally likely. Cryptanalysis is fundamentally impossible.

The information theory is absolutely groovy, but the application of it is unfortunately impractical.

Re:A hacker stole $31M of Ether – how it happened, and what ... by jessriedel on Friday July 21, 2017 @12:13AM (#14818014)
Formally, the condition isn't "never use a one-time pad with the same key numbers" it's "make sure the key numbers of each pad are statistically independent of each other".

Not that it matters. The sqrt(n) birthday effect isn't sufficient to overcome the exponentially low chance of a one-time pad collision for pads of any substantial size.

Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @12:23AM (#14818051)
> Formally, the condition isn't "never use a one-time pad with the same key numbers" it's "make sure the key numbers of each pad are statistically independent of each other".

And to expand on this - this is why it is imperative that a source of true randomness is used as a seed. Pseudorandomness cannot (by definition) satisfy statistical independence.

If you don't have a source of true randomness, you've just implemented a stream cipher, not a one-time pad.

Re:A hacker stole $31M of Ether – how it happened, and what ... by PeterisP on Friday July 21, 2017 @06:51AM (#14819415)
One-time pad means that you have a limit to how much data you can exchange before the pad is spent - if you send enough messages, then you can't send any more securely until you exchange another one-time pad.

You're not likely to get a collision ever because of the typical sizes of one-time pads - birthday paradox matters if the key length is measured in bytes, but not if it's measured in gigabytes, there isn't enough space/time in our universe to expect a collision.

Re:A hacker stole $31M of Ether – how it happened, and what ... by ikeboy on Friday July 21, 2017 @12:01AM (#14817970)
Use a new one time pad for every message.
Re:A hacker stole $31M of Ether – how it happened, and what ... by hinkley on Friday July 21, 2017 @12:06AM (#14817991)
Are you suggesting we use the one time pad only one time?

Well if it's that important maybe they should put that right in the name...

Re:A hacker stole $31M of Ether – how it happened, and what ... by HaseebQ on Friday July 21, 2017 @01:20AM (#14818242)
Hey, author here. I tried to write this article to be accessible to people with little background in security and cryptography (hence its publication on FreeCodeCamp), and to be friendly to non-developers. I took a few liberties with the crypto explanations (like calling a private key to a "secret password") in the hopes of making things more understandable for a general audience. Definitely didn't use rigorous language in just about anything here. :)
Re:A hacker stole $31M of Ether – how it happened, and what ... by redcap on Thursday July 20, 2017 @11:52PM (#14817940)
the algorithm may be nigh-on unbreakable, but the implementation can always have flaws. Getting crypto right is hard.
Re:A hacker stole $31M of Ether – how it happened, and what ... by CydeWeys on Thursday July 20, 2017 @11:47PM (#14817922)
One time pad encryption is unbreakable given integrity of the pad material itself.
Re:A hacker stole $31M of Ether – how it happened, and what ... by InclinedPlane on Thursday July 20, 2017 @11:51PM (#14817937)
And, how do you build one time pad encryption into ethereum?
Re:A hacker stole $31M of Ether – how it happened, and what ... by dsacco on Friday July 21, 2017 @12:11AM (#14818006)
You can't. Or, well, you can, but it's redundant. One-time pads make sense in the Cold War, Vernam Square era of cryptography. But now that we have the internet and public key cryptography, a one-time pad implemented in Ethereum would be inane and frivolous.

Take Alice and Bob, who want to communicate confidentially. Alice doesn't know Bob personally, so she can't securely communicate the one-time pad to Bob in person. Ethereum implements public-key cryptography, so she uses Bob's public key to send him the one-time pad's key. But now we're at the chicken and egg problem: we've just witnessed secure communication, so why do we want to use a one-time pad in the first place?

Alice and Bob might respond, "so we can have perfect secrecy at some point in the future!" Which...alright, sure, let's go with it. So now to implement the one-time pad in Ethereum, Alice needs to feed a source of true randomness as a seed for a secret key which is as long as the plaintext. This is not only a genuinely hard problem, but it's grossly inefficient to encrypt something using a secret key as long as the plaintext itself. But wait - for every new plaintext, Alice has to do this true random seed song and dance each time to generate a new secret key. And every secret key ever used needs to be kept perfectly secret as well.

You really just don't want to do this. One-time pads barely made sense in pre-modern cryptography; they don't solve any practical problems in modern cryptography, and their demands require steep usability sacrifices that are quite easy to screw up.

Re:A hacker stole $31M of Ether – how it happened, and what ... by InclinedPlane on Friday July 21, 2017 @01:12AM (#14818214)
My question was more: how do you ensure a system that has true secrecy for its one time pad data when all the source is open?
Re:A hacker stole $31M of Ether – how it happened, and what ... by PeterisP on Friday July 21, 2017 @06:58AM (#14819446)
The code will inevitably need to use a source of true randomness, which will be external to your source code, by definition it can't be a deterministic formula, it needs to use external input from physical devices.
Re:A hacker stole $31M of Ether – how it happened, and what ... by InclinedPlane on Friday July 21, 2017 @09:32PM (#14824938)
And? You've just moved the problem, you haven't solved it. How do you guarantee that your source is what you think it is? If you can't trust anything outside your source code, then you can't trust anything outside your source code.

If you can't trust, say, a url or an IP address. Then you can't trust those things to host a source of randomness either. Security is only as strong as the weakest link, if you try to obfuscate a weak-link by surrounding it with impressive looking junk, that doesn't make it stronger.

Re:A hacker stole $31M of Ether – how it happened, and what ... by PeterisP on Saturday July 22, 2017 @07:36AM (#14826669)
I'm not moving the problem, I'm stating that the problem (as it seems you're stating it) is unsolvable, you simply cannot have a closed crypto system where looking at the source is sufficient to ensure that it's secure.

You need an external source of entropy to generate the key material required for any cryptography. It can't be in your code because any code is fundamentally incapable of doing that. If your source of entropy is compromised, then none of cryptographic systems are safe, not symmetric, not asymmetric, not one-time pads, not anything else.

Yes, you can't trust an url or an IP address - but you should be able to trust your hardware, and that commonly offers some decent sources of entropy. You can also trust yourself - e.g. user-action derived entropy. If you don't trust your hardware, tough luck, get trusted hardware. If your key material isn't generated properly, then your crypto will not be secure.

It doesn't mean that the method is flawed or insecure. All methods are the same in this regard, it simply means that security requires not only secure code, but also other precautions - e.g. secure generation of keys, secure management/storage of keys, secure platform on which to run your code, etc, etc. If you have a secure algorithm, proper implementation, best practices everywhere else, then your system will still be insecure if you fail e.g. to store your keys securely and someone gets them.