Slashdot Mirror


All Bitcoin Wallets On Android Vulnerable To Theft

judgecorp writes "Bitcoin users have been warned that storing them in a wallet app on Android is insecure, A weakness in Android's random number generator means its random numbers may not be so random, giving attackers a chance of breaking into the wallet. those with Bitcoins have been advised to put them elsewhere, by bitcoin.org"

137 comments

  1. How can an OS have such a fundamental problem? by Karganeth · · Score: 5, Interesting

    It's ridiculous in this day and age that an OS can fail to make random numbers properly. That's one of the most basic operations. How lazy/incompetent are the Google programmers?

    1. Re:How can an OS have such a fundamental problem? by buchner.johannes · · Score: 1

      It's a pity. Bitcoin would be a powerful payment method on mobile devices, for small amenities (e.g. coffee).

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    2. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      int rnd(){
              return 4;
      }

    3. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      okay

    4. Re:How can an OS have such a fundamental problem? by gweihir · · Score: 4, Insightful

      It is both a solved problem and an ignored problem. I find that I have to explain the risks of not using proper random numbers for anything cryptographic time and again even to customers with experience in using cryptography. I blame the CS and programmer education, which is still badly broken when it comes to security.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    5. Re:How can an OS have such a fundamental problem? by _merlin · · Score: 1

      Not really - transaction processing takes far to long because the network has to agree on it.

    6. Re:How can an OS have such a fundamental problem? by buchner.johannes · · Score: 1

      Not really - transaction processing takes far to long because the network has to agree on it.

      How long does it take these days?

      If the store uses what they would pay as fees to credit card companies as Bitcoin safety, it would probably still pay off. Also, only few people will not pay, especially not returning customers.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    7. Re:How can an OS have such a fundamental problem? by LordLucless · · Score: 1

      Which is why such methods are called PRNGs - Pseudo-Random Number Generators

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    8. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      We won't know until we get actual technical details of the flaw.
      Frankly, bitcoin developer incompetence is a safe assumption until proven otherwise, and even then, so I'll hold off judgement of the Android developers until I see the broken code.

    9. Re:How can an OS have such a fundamental problem? by MickLinux · · Score: 2

      Question: would it be correct or incorrect to...

      suppose you take your best pseudo-random generated number, and xoror seed it with a word made by stringer together the second-lowest bit each from the temperature gauge, the gps-x the gps-y ,the compass, the ping time, and so on?

      Would that #increase# or #decrease# the entropy on the random number generator?

      --
      Correct Horse Battery Staple: 72 bits of entropy. Enter "Correct H" into google. When it generates the phrase, that's
    10. Re:How can an OS have such a fundamental problem? by bondsbw · · Score: 5, Insightful

      This doesn't mean you throw in the towel. There are bad PRNG algorithms and better PRNG algorithms, and it's worth using better ones.

      Plus, these devices have so many sensors that finding a fairly complex and truly random seed isn't all that difficult. Then throw the seed into a good PRNG and it becomes practically impossible to decode the seed values and, thus, produce any mechanism for finding patterns in the seed data.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    11. Re:How can an OS have such a fundamental problem? by Saint+Gerbil · · Score: 2

      Number confirmed to be random as certified by a dice roll.

    12. Re:How can an OS have such a fundamental problem? by DanTheManMS · · Score: 1

      I imagine that some sort of store-credit type thing would work better for this type of scenario. For instance, while credit cards give you a real-time accepted/denied decision, it still takes days for the transaction to fully process on the back-end. I imagine that Starbucks is a lot more certain that transactions will go through when paid with one of their pre-paid store cards.

      It's a bit more inconvenient, I will admit. But it makes commonplace Bitcoin transactions a lot more realistic. And the concept isn't unheard of, actually. When the Bitcoin protocol adapted to make microtransactions unfeasible (as that was never truly the goal of Bitcoin, and microtransactions spam up the blockchain a lot) it basically broke all of the "daily bitcoin faucet" type websites that could no longer be profitable. In response, a third-party website popped up that stores records of your "free daily bitcoin" microtransactions, and outputs an actual Bitcoin payment once it's reached the threshold that makes it profitable again. I think I explained that poorly, for which you must forgive me. It's early on Monday morning after all.

      Long story short, while this is a setback, I don't view this exploit as a game-changer, not with the momentum that Bitcoin has behind it right now.

    13. Re: How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 1

      "The generation of random numbers is too important to be left to chance." -- Robert R. Coveyou

    14. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 2, Interesting

      Question: would it be correct or incorrect to...

      suppose you take your best pseudo-random generated number, and xoror seed it with a word made by stringer together the second-lowest bit each from the temperature gauge, the gps-x the gps-y ,the compass, the ping time, and so on?

      Would that #increase# or #decrease# the entropy on the random number generator?

      It would increase it only if you aren't showing a temp of 32F and a GPS of 00N/00W heading of 0, and a ping of 0 and so on. Seeding from things that arent *surely* good and random is not a smart idea. Why didn't you mention the accelerometers? A program with a little sense to turn on the accels, ask you to shake the phone up a bit, and validate that the results aren't all the same should yield enough to do a good unpredictable RNG seed.

    15. Re:How can an OS have such a fundamental problem? by Joce640k · · Score: 4, Insightful

      The problem isn't doing it, the problem is in getting the "random needs effort" message though thick developer's skulls.

      (Same as most other cryptographic problems, eg. correctly implementing AES isn't what makes your code secure, it's only the very first step...)

      --
      No sig today...
    16. Re:How can an OS have such a fundamental problem? by TheCarp · · Score: 5, Informative

      Depends pm what you mean. Any time there are less than, I believe the number is 5400 blocks in two weeks, that the hardness adjusts to attempt to maintain, or about one block every 10 minutes. Technically, if someone can present a valid transaction, you could accept it instantly and say bitcoin has no delay.

      Technically the transaction isn't official till its in a block, but once its transmitted out to the network valid, its almost guaranteed to be in one within 10 minutes or so, and each block that buries it, solidifies it further.

      What is accepted? Last I looked, the default client didn't consider a transaction accepted until several blocks AFTER it was accepted, so we are talking 20-30 minutes or so.

      But.... you could accept bitcoins "instantly" (pretty quick anyway) if you have the most recent block chain, and are sure the transaction has been transmitted out to the public network. There are some small risks in terms of the possibility of accepting a transaction while the block chain is split and a competing transaction being inserted into the other chain, which then wins.... but.... if anyone really does make exploiting such a situation practical and profitable, countermeasures could be achieved pretty easily, it wouldn't be hard to use multiple nodes to watch for block chain splits and monitor what transactions are going out.

      Have a few nodes that are not peers of eachother, one transmits the transaction, all the rest watch for it, and watch for splits/competing transactions, etc. I am sure somebody can come up with a pretty safe way to fast accept bitcoins if they haven't already.

      --
      "I opened my eyes, and everything went dark again"
    17. Re:How can an OS have such a fundamental problem? by Jumperalex · · Score: 0

      Hmmm not sure that actually works at all. I mean really, I'm not sure. Here's my thinking:

      No matter how random the seed is, if you ultimately are pulling from a pseudo random algorithm you have a risk of collisions which iirc is the problem. By your description it would be valid to say, "generate a random seed and then use that to choose from a PRNG that is based on choosing a 0 or 1 depending on the seed's even/odd status" It may be an overly simplistic example, but no matter how complex the PSNG algorithm, or how you seed it, it is ultimately still an algorithm that can allow for generating collision.

      But I'm willing to concede I might be missing something in your example. It just seems better to use the random seed in the first place rather than throw it into some PRNG.

      --
      If you can't be good, be good at it!
    18. Re:How can an OS have such a fundamental problem? by radiumsoup · · Score: 2

      There are workarounds to this already in use. Bitinstant is one that promises trusted "instant" transactions for bitcoin with specific vendors, although they're reworking their website right now. Others will follow. It'll be a matter of dealing with trusted big-name transaction clearinghouses that settle bitcoin transactions in real-time between their own customers while also transmitting to the network for inclusion in the chain later.

    19. Re:How can an OS have such a fundamental problem? by bill_mcgonigle · · Score: 4, Informative

      There are bad PRNG algorithms and better PRNG algorithms, and it's worth using better ones. Plus, these devices have so many sensors that finding a fairly complex and truly random seed isn't all that difficult.

      Great insight. I don't understand why linux still uses a known-weak /dev/[u]random when BSD and OSX have used a Yarrow-based PRNG for a decade, and there was even a patch for a Fortuna-based device in the -mm tree at one point.

      One of the issues is people say, "just use EGD", but most people don't know about it, don't have it running, and software often uses egd only when /dev/random doesn't exist, if it can use it at all. Having two interfaces isn't the right approach. I can see an argument for leaving something like accelerometer-based entropy gathering in userspace, but as far as I know, there's not a socket setup in place where egd can feed data to /dev/random's pool.

      Perhaps we need somebody to grab hold of this issue and drive it forward. Strong crypto is becoming more and more important by the week.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    20. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      I'm sure a million monkeys typing would come up with a proper algorithm, in time...

    21. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      Nobody has offered any evidence at all that there's any problem in java.security.SecureRandom on Android.

      They've made a bald assertion, and now they promise that they've fixed the problem they just discovered. Well that's nice.

      Guy comes into your store, says your cash register is mis-calibrated. You let him open a few drawers, fool around, he closed it all up and says its fixed now.

      End of the day your register checks out, but weirdly you've taken about $1000 less than usual. Huh. Maybe there were _two_ miscalbrations and you should invite that guy back. Seems he's left town though.

    22. Re:How can an OS have such a fundamental problem? by telchine · · Score: 1

      It's ridiculous in this day and age that an OS can fail to make random numbers properly. That's one of the most basic operations. How lazy/incompetent are the Google programmers?

      To be fair, aren't random numbers genuinely hard to produce with a computer?

      I'd have thought that a mobile phone would be a great source of genuinely random data though. Surely tapping into a compass, an accelerometer or a camera could produce genuinely random input?

    23. Re:How can an OS have such a fundamental problem? by telchine · · Score: 1

      Not really - transaction processing takes far to long because the network has to agree on it.

      I dunno, in a cafe you usually pay after you've eaten. I'd assume the time it takes to drink a coffee would be ample time to have a bitcoin transaction approved.

    24. Re:How can an OS have such a fundamental problem? by killkillkill · · Score: 1

      The effort to create a double spend is not free. For most transaction in day to day life the effort cost and chance involved would be more than the transaction itself, so not worth trying. A transaction propagates through the network pretty much instantly and they can be on their way with a cup of coffee/groceries with less risk than a credit card being charged back. And of course, if you're not paying to Visas rates for the transaction you can afford a bit more risk even if it were present. For a car, internet purchases, an overseas transfer or any large transfer were the risk exists for a profitable double spend; an hour is reasonable to wait for full confirmation of the network.

    25. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      Yes. We lose half of the available keyspace (no, not in terms of bits but values) in case the seed is exactly as long as the key and is completely random. Horrors.

    26. Re:How can an OS have such a fundamental problem? by xaxa · · Score: 2

      I'm not a cryptographer, but....

      If your random seed really is random, then it's better. But your random source might not be able to provide enough numbers (how often is it sampling the environment?), and according to http://en.wikipedia.org/wiki/Hardware_random_number_generator it's best to constantly check if the numbers are still random.

      "collisions" isn't the problem, it's repeating the sequence. (Ask people to draw random dots on paper and they'll often draw quite an even distribution. That's not random!)

      There are also uses of random numbers outside cryptography.I came across this: http://en.wikipedia.org/wiki/Mersenne_twister which is good for some uses, but bad for cryptography.

    27. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      Whoa. I thought linux used yarrow, so I googled about it and it seems it's written by people who know just about enough to be dangerous.

    28. Re: How can an OS have such a fundamental problem? by Statecraftsman · · Score: 1

      Just a few corrections. The targeted rate is 2016 blocks per 14 days. The default client allows you to spend incoming coins after one confirmation.

    29. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 1

      NO! You can not accept a transaction without it being in the blockchain, lest you enable the spender to double-spend. It doesn't take a split. The spender can just issue a different transaction on the same sources after you've accepted the transaction and before "your" transaction goes into the blockchain.

    30. Re:How can an OS have such a fundamental problem? by Tyler+Eaves · · Score: 1

      History suggests that you are using a very loose definition of "trusted".

      --
      TODO: Something witty here...
    31. Re:How can an OS have such a fundamental problem? by serviscope_minor · · Score: 1

      The problem isn't doing it, the problem is in getting the "random needs effort" message though thick developer's skulls.

      You think that, but you have no idea the depths of perversity developers will go to to avoid learning the simple facts that you have internalised.

      This developer clearly believed that random numbers do indeed need effort:

      http://thedailywtf.com/Articles/Random-Stupidity.aspx

      --
      SJW n. One who posts facts.
    32. Re:How can an OS have such a fundamental problem? by bondsbw · · Score: 1

      It just seems better to use the random seed in the first place rather than throw it into some PRNG.

      You're not incorrect, but it's more of an obfuscation technique. Even natural data that may seem random may be prone to patterns, and sensors all too often have flaws that are unnoticeable for their designed purpose but produce subtle patterns in what would be otherwise purely random data.

      My thought is to combine as many flavors of this data as is reasonable, and put it all through cryptographic-strength PRNG to help protect the original seed value and thus the randomness of it. Increased algorithmic strength means you will need to rely on polling sensors less often, which will reduce the likelihood of guessing a new value based on any known device flaws.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    33. Re:How can an OS have such a fundamental problem? by tlhIngan · · Score: 1

      It's ridiculous in this day and age that an OS can fail to make random numbers properly. That's one of the most basic operations. How lazy/incompetent are the Google programmers?

      Especially since most SoCs used in Android actually have hardware cryptographic accellerators, and one feature of them was a hardware RNG.

      Granted, hardware RNGs vary in quality, but most do a very decent job. Even several generations old CPUs have RNG instructions (Intel CPUs, for example - they've had RNGs built in since Core2 days I believe).

    34. Re:How can an OS have such a fundamental problem? by WaffleMonster · · Score: 1

      The problem isn't doing it, the problem is in getting the "random needs effort" message though thick developer's skulls.

      I'm sorry this is unacceptable and dangerous. Expecting developers to get this right is inviting platform failure the same way expecting developers to get SQL and HTML escaping right has earned PHP a certain reputation or expecting Android users to understand the repercussions of allowing n00b0wnrz flashlight app to run on their device has doomed millions of end users to ownage.

      In 2013 random numbers should just work by default with no effort on the developers part either by an OS managed entropy pool (e.g. /dev/urandom) and by assist of hardware features (e.g. thermal noise)

      (Same as most other cryptographic problems, eg. correctly implementing AES isn't what makes your code secure, it's only the very first step...)

      Implementing AES? Understanding high level crypto libraries and not ever calling AES is what gives your code any chance of being secure. The second you call AES you have already failed.

    35. Re:How can an OS have such a fundamental problem? by TheCarp · · Score: 1

      Meh, you are right of course, but, there is always some tradeoff between convinence and risk. Yes, theoretically the safe bet is to wait for it to enter the block chain, and even safer, to wait for a few confirmations. You know what though, many transactions that people do, are ones where this level of risk is acceptable because the barrier to cheating outweights the benefit for low value transactions.

      I mean seriously, how many vendors accept credit cards now? Do you really think the risk involved with dealing with credit card processors is lower than that of accepting bitcoin transactions instantly? Some amount of risk is always acceptable; its just a matter of where you draw that line.

      Frankly, I think it should be possible to reasonably mitigate most of those concerns without much change in the system.

      --
      "I opened my eyes, and everything went dark again"
    36. Re:How can an OS have such a fundamental problem? by SlashV · · Score: 1

      Have you ever looked at the android source code? I have done some hacking on cyanogenmod and it's amazing what kind of crap can be found in a code base that is being used by several hundred million(!) people..

    37. Re:How can an OS have such a fundamental problem? by SlashV · · Score: 1

      I would say the main advantage of bitcoin is that you *don't need* "big-name transaction clearinghouses". If you use those, you might just as well just pay with your creditcard.

    38. Re:How can an OS have such a fundamental problem? by kasperd · · Score: 2

      It is build on top of Linux, which has /dev/urandom. I'd like to know if this is a generic kernel bug, or if Android doesn't use /dev/urandom.

      You could work around such issues in user code. You could for example have your own 20 byte random seed which you concatenate with 21 bytes from the system random number generator and 14 bytes from other sources (the later don't need to be high entropy, every extra bit helps). Now send the entire 55 bytes through SHA1 and store the output as seed for the next iteration.

      --

      Do you care about the security of your wireless mouse?
    39. Re:How can an OS have such a fundamental problem? by Hentes · · Score: 1

      There's a tradeoff between security and speed. Android have chosen speed since most apps using a RNG are just games that don't care much about the quality. I guess the philosophy is that apps that rely on cryptographically strong random numbers will make their own RNG or use a third-party one.

    40. Re:How can an OS have such a fundamental problem? by IamTheRealMike · · Score: 1

      No, he can't. He can try and race your broadcast, but miners do not accept double spends against the mempool. You can't just arbitrarily replace transactions like that. If you receive an unconfirmed transaction, unless your opponent has a ton of mining power and can choose the exact moment he purchases from you, and the good he's buying is immediately and irreversibly deliverable, it's not typically an issue.

    41. Re: How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      You are understating the risks, something simple like double spending would be exploited on a large scale and in a hurry.

    42. Re:How can an OS have such a fundamental problem? by ultranova · · Score: 1

      It's ridiculous in this day and age that an OS can fail to make random numbers properly. That's one of the most basic operations.

      But also one of the most difficult ones, since computers are by design deterministic and we would ideally have each bit be independent of anything else in existence. So you either need specialized hardware or rely on some kludgy workaround, such as timing system events. But of course if you do use specialized hardware, you not only get more costs but are now trusting a black box to not contain any nasty surprises.

      How lazy/incompetent are the Google programmers?

      Probably neither, just not absolutely perfect. And that's all it takes to break a cryptosystem.

      This isn't the first time that random number generation has turned out to be a weak spot.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    43. Re:How can an OS have such a fundamental problem? by jeffmeden · · Score: 1

      Meh, you are right of course, but, there is always some tradeoff between convinence and risk. Yes, theoretically the safe bet is to wait for it to enter the block chain, and even safer, to wait for a few confirmations. You know what though, many transactions that people do, are ones where this level of risk is acceptable because the barrier to cheating outweights the benefit for low value transactions.

      I mean seriously, how many vendors accept credit cards now? Do you really think the risk involved with dealing with credit card processors is lower than that of accepting bitcoin transactions instantly? Some amount of risk is always acceptable; its just a matter of where you draw that line.

      Frankly, I think it should be possible to reasonably mitigate most of those concerns without much change in the system.

      Getting a credit card in multiple places at the same time (to make instant transaction fraud practical/profitable) is pretty tricky AND illegal. Getting a bitcoin wallet in the same place at the same time is trivial AND legal. There is also a healthy margin included in credit card fees, specifically to account for fraud. People will not want to switch to a system where fraud was hot-potatoed to the last one holding the invalid bitcoin transaction, no matter how many technical advancements are layered on to make it harder. This makes Bitcoin useless as an in-person instant payment system.

    44. Re: How can an OS have such a fundamental problem? by TheCarp · · Score: 1

      Understating? Maybe, thats debatable at least.

      Certainly there are many cases we could be talking about. If I were doing a bitcoin exchange of 100 btc, which currently is around 10k, then yes, you better believe I would expect 2 or even 3 confirmations before it was considered accepted.... but what about.... a cup of coffee for a small fraction of a bitcoin? There are many small transactions where cheating just isn't worth it, those are the only ones I would suggest ever do something like this. Its all a matter of what risk you are willing to take.

      On top of this, I do think this sort of system could mitigate some of this risk. Imagine a setup where you have a transaction processor, could be local, could be a service. The processor has several bitcoin nodes, which are not peered with eachother. Consider a transaction valid if A) It has been seen at multiple nodes (proves it is propagating) and B) There are no other seen and unprocessed transactions which would invalidate this one.

      Now a double spend is technically possible, but unlikely to work. It is a risk, yes, but if all you have on the line is $3-$10 worth of coins.... it is probably an acceptable risk. If someone does double spend, you lose, but you don't loose much, and the only confidence destroyed is in the instant acceptance mechanism.

      The real question is not will it be abused, but, will the convinenece bring in more profit than the losses from bad actors?

      --
      "I opened my eyes, and everything went dark again"
    45. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      How is the Linux PRNG known-weak?
      I'm not aware on any practical or even theoretical attacks on it unless SHA-1 is super broken. (Way more broken than the current still-not-practical collision attacks.)
      Which sources you use for entropy is an orthogonal matter from which PRNG implementation you use.

      You can feed randomness to /dev/random simply by writing to it - this may increase the "real" entropy if your source is good, but it won't increase the estimated entropy, since the kernel can't trust the quality of the input.

    46. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      This assumes that the values returned by the accelerometers don't also follow a dampened value or that the analog output value is not being tracked and logged (for troubleshooting)

      Generating truly random numbers from a device that's power limited is always going to be both tricky and expensive (in terms of power required) And for the MASSES, inflating the battery number over the "random number generation rate" wins every time.

    47. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      None of this is helped, in my view, by the attitude that many developers (and which cryptographers do little to dispel) that security is dark voodoo that is impossible to understand without going through some bizarre initiation ritual. It isn't. Cryptographic systems have well-known properties, and it is perfectly possible for a non-expert to reason about what happens when you combine them in novel ways. Yes, there are pitfalls, but anybody reasonably competent can spot them and avoid them, as long as they put a little effort into it.

      Instead, we've ended up with a culture where competent programmers are afraid of attempting to do anything cryptographic themselves, and instead implement cryptography by rote copying and transliteration of existing systems, without even attempting to understand what they're doing. Is it any wonder that errors creep in?

    48. Re:How can an OS have such a fundamental problem? by mcrbids · · Score: 1

      I'd think that an Android device has a number of excellent sources of randomness: Wifi signal, cell signal, accellerometer inputs, and light sensor light levels in conjunction with the usual *nix generators based on system load variables (memory/cpu/io) should mean that mobile devices should have *excellent* randomness.

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    49. Re:How can an OS have such a fundamental problem? by TheCarp · · Score: 1

      > Getting a credit card in multiple places at the same time (to make instant transaction fraud
      > practical/profitable) is pretty tricky AND illegal. Getting a bitcoin wallet in the same place at the
      > same time is trivial AND legal.

      Legal? Pretty sure its still fraud. Not only that but it leaves behind a signed transaction that only the fraudster could have produced. We have already seen someone lose in court after trying the "But bitcoins are not real money" excuse. They are, and a contract is a contract, even if its verbal or implicit in the transaction.

      > There is also a healthy margin included in credit card fees,
      > specifically to account for fraud. People will not want to switch to a system where fraud was
      > hot-potatoed to the last one holding the invalid bitcoin transaction, no matter how many technical
      > advancements are layered on to make it harder. This makes Bitcoin useless as an in-person instant
      > payment system.

      Why not? Not every fraud is equal, and vendors, at least smart ones, are willing to put up with some amount of "shrink" (as they like to call it) if reducing it to zero is not worth the cost. I think you are overrestimating people's aversion to risk. They may not like it when you describe it in those terms, but, it is really no different from other areas of business; and its just another cost of doing business.

      --
      "I opened my eyes, and everything went dark again"
    50. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      Have you ever looked at the android source code? I have done some hacking on cyanogenmod and it's amazing what kind of crap can be found in a code base that is being used by several hundred million(!) people..

      It's not that amazing to anyone who's ever used the system. My phone crashes on an almost daily basis, requiring a hard reboot. A friend has one that works OK, except sometimes when a call comes in the call screen takes too long to show up and he can't answer it. And his home screen has become shifted 100 pixels to the right, with no apparent way of getting it back. Another friend is constantly annoyed by the fact that MP3 players on the system (he's tried several) constantly stutter and skip, and distort some of his files (hard clipping of the waveforms, which play back perfectly fine on PC-based players).

    51. Re:How can an OS have such a fundamental problem? by mindwhip · · Score: 1

      Every time RNG in Android crops up I can't but think of this discussion...
      http://code.google.com/p/android/issues/detail?id=42265

      --
      [The Universe] has gone offline.
    52. Re:How can an OS have such a fundamental problem? by slew · · Score: 2

      There are also uses of random numbers outside cryptography.I came across this: http://en.wikipedia.org/wiki/Mersenne_twister [wikipedia.org] which is good for some uses, but bad for cryptography.

      Pet peeve of mine, but people often casually use MT as an example of a "golden" PRNG when it is really the first (1997) "popular example" for generating extremely long period uniform distributions using a generalized LFSR-like technique. Unfortunatly with simplicity come certain flaws. The biggest flaw is that it takes many iterations for a seeded initial state to get to a state that is really random. For user that aren't simulating huge universe-sized things (or need an extremely large non repeating, but uniform distribution PRNG), this isn't really the best tradeoff. If you have to throw away the first million numbers to sample a few thousand, that isn't the best efficiency ratio.

      Fortunatly, most things get improved over time. For example, the "WELL" PRNG (2004) claims to have a faster state randomization time and is probably suited more to the needs of people wanting a default off-the-shelf PRNG for medium sized simulation purposes (e.g, the average scientist that doesn't spend time researching the properties of PRNGs for their simulations). Sadly, WELL isn't more popular since it is a better default PRNG for nearly all uses.

      If your needs are more cryptographic based, DRBGs (deterministic random bit generators) are designed to resist identification of the current state (I've heard that it only takes observing 624 iterations to identify MT19937's state vector) and to reasonably stretch any existing true-random sources. NIST has some reasonably good standardized examples of these EXCEPT for Dual_EC_DRBG which paranoid folks should probably avoid...

    53. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      If you accept a transaction before it is in the blockchain, then miners have exactly nothing to do with what's going on. The context here is an instant transaction. If you can wait, you wait, but here the recipient doesn't want to wait, so the attacker can indeed choose the exact moment of payment and product exchange. You can not accept a transaction before it has entered the blockchain. If you do anyway, you will get duped.

    54. Re:How can an OS have such a fundamental problem? by ultranova · · Score: 0

      You could for example have your own 20 byte random seed which you concatenate with 21 bytes from the system random number generator and 14 bytes from other sources (the later don't need to be high entropy, every extra bit helps). Now send the entire 55 bytes through SHA1 and store the output as seed for the next iteration.

      And since SHA1 has a fixed length, the 20 bytes with zero entropy you fed into it forced out some of whatever entropy the other 35 bytes contained. Luckily, in this case you only force out some of SHA1's chunk padding, but you still aren't accomplishing anything useful by adding compile-time constants either.

      Cryptography is something that really, really, really should be left for the experts rather than just hacked together on gut feeling.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    55. Re:How can an OS have such a fundamental problem? by You're+All+Wrong · · Score: 1

      "Trusted" to a cryptographer means "if this guy doesn't do what he claims to, the system breaks". It's nothing to do with being trustworthy.

      --
      Your head of state is a corrupt weasel, I hope you're happy.
    56. Re:How can an OS have such a fundamental problem? by Entropius · · Score: 1

      If you need a source of entropy on the Sprint network, you could always just use the rate of dropped calls...

    57. Re:How can an OS have such a fundamental problem? by Anonymous Coward · · Score: 0

      It's ridiculous in this day and age that an OS can fail to make random numbers properly. That's one of the most basic operations. How lazy/incompetent are the Google programmers?

      These are the same programmers who were too lazy to write rangeCheck by themselves, they had to copy and paste. Remember?

    58. Re:How can an OS have such a fundamental problem? by Pathwalker · · Score: 1

      I believe the issue carried over from Apache Harmony, if this is the issue at fault.

    59. Re:How can an OS have such a fundamental problem? by IamTheRealMike · · Score: 1

      Er, no. That's now how Bitcoin works, nor is it how it is intended to work. I suggest you review the codebase and try again.

    60. Re:How can an OS have such a fundamental problem? by OneAhead · · Score: 0

      People like you, who think they know something about security but really don't, are the reason why this bug occurred in the fist place.

      /dev/urandom is not a cryptographically secure source of random numbers. /dev/random is (when correctly implemented). In fact, it's supposed to be better than the frivolous combining-bits-and-hashing scheme you propose. And with all its sensors, a smartphone should have a pretty nice inflow of high-quality entropy.

    61. Re:How can an OS have such a fundamental problem? by gweihir · · Score: 2

      Indeed. You need to know that your entropy sources provide _more_ entropy than needed in the worst case.

      But the problem in this case seems to be that Java SecureRandom is broken, while the Linux kernel /dev/random is perfectly fine, yet unused. There seem to be BitCoin apps for Android that are not vulnerable, because the y use /dev/random. This basically means that the designers of Java SecureRandom on Android messed up badly. Which is a disgrace, as it means Google had nobody with actual security skills on that team. Pathetic.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    62. Re:How can an OS have such a fundamental problem? by gweihir · · Score: 1

      Indeed. And add to that "secure crypto needs independent review". But I guess Google does not have enough money to pay for that. Oh, wait.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    63. Re:How can an OS have such a fundamental problem? by kasperd · · Score: 2

      /dev/urandom is not a cryptographically secure source of random numbers.

      Maybe you should actually have taken a look at the source before trying to educate somebody who has. It is clearly stated in the source, that /dev/urandom produces cryptographically strong random numbers.

      /dev/random is (when correctly implemented). In fact, it's supposed to be better than the frivolous combining-bits-and-hashing scheme you propose.

      LOL. You probably don't even know the difference between what I proposed and what /dev/random does. They are more similar than you imagine.

      --

      Do you care about the security of your wireless mouse?
    64. Re:How can an OS have such a fundamental problem? by kasperd · · Score: 2

      And since SHA1 has a fixed length, the 20 bytes with zero entropy you fed into it forced out some of whatever entropy the other 35 bytes contained. Luckily, in this case you only force out some of SHA1's chunk padding

      Nothing is forced out. 55 bytes plus padding fits within a single block of SHA1 compression.

      but you still aren't accomplishing anything useful by adding compile-time constants either.

      I didn't propose usage of any constants.

      Cryptography is something that really, really, really should be left for the experts rather than just hacked together on gut feeling.

      I don't hack things together on gut feeling. I wouldn't have proposed an exact algorithm if there was a risk it could make security worse. Since the hash input has 21 bytes from the system random number generator, and the hash output is only 20 bytes, that output is going to have at least as much entropy per bit as the system random number generator produced in the first place (unless you find a vulnerability in SHA1). The remaining 34 bytes are only there to strengthen the random numbers in case the system random number generator, you would have used otherwise, does not provide sufficient entropy.

      --

      Do you care about the security of your wireless mouse?
    65. Re:How can an OS have such a fundamental problem? by delt0r · · Score: 1

      Cryptographic randomness is not easy. Its not easy in hardware either and the hardware still doesn't support a random generator.

      --
      If information wants to be free, why does my internet connection cost so much?
    66. Re:How can an OS have such a fundamental problem? by delt0r · · Score: 1

      It is not a solved problem. Generating truly random numbers is hard. Even with hardware, which should be part of every cpu, its not that easy either.

      --
      If information wants to be free, why does my internet connection cost so much?
    67. Re:How can an OS have such a fundamental problem? by cbhacking · · Score: 1

      The problem is that they're using /dev/urandom when they should be using /dev/random. /dev/urandom is a PRNG, and apparently (on Android, at least) not a very good one. Dalvik's SecureRandom should be using /dev/random instead - yes, it can block and cause loss of responsiveness (stop doing expensive operations on your UI thread, numbskulls...) - but they went for the less-secure option of using urandom for *everything*.

      --
      There's no place I could be, since I've found Serenity...
    68. Re:How can an OS have such a fundamental problem? by cbhacking · · Score: 1

      That's why there's /dev/random and /dev/urandom. The problem is, they use /dev/urandom for everything, including their so-called SecureRandom implementation.

      --
      There's no place I could be, since I've found Serenity...
    69. Re:How can an OS have such a fundamental problem? by kasperd · · Score: 1

      The problem is that they're using /dev/urandom when they should be using /dev/random. /dev/urandom is a PRNG, and apparently (on Android, at least) not a very good one.

      A Google employee who is involved with bitcoin told me, that the way the problem got fixed was by using direct reads from /dev/urandom.

      --

      Do you care about the security of your wireless mouse?
    70. Re:How can an OS have such a fundamental problem? by OneAhead · · Score: 1

      It is clearly stated in the source, that /dev/urandom produces cryptographically strong random numbers.

      Oh, really? Guess they'll have to update the Linux man page then...
      http://stackoverflow.com/a/3690285
      http://linux.die.net/man/4/urandom
      http://en.wikipedia.org/wiki//dev/random#Linux

  2. Random numbers that aren't random by Anonymous Coward · · Score: 0

    are a threat to other cryptographic systems as well, but I'm sure the bug in Android's random number generator was just an honest mistake, even though it is implemented on top of a kernel that already has a working and well-tested random number source.

  3. The bigger issue... by supersat · · Score: 5, Informative

    ... is that supposedly Android's "secure" random number generation... isn't. This could potentially affect much more than Bitcoin wallets.

    Does anyone know what the issue is? This article seems to suggest it's a vulnerability in the SecureRandom class, but no actual details.

    1. Re:The bigger issue... by Anonymous Coward · · Score: 0

      http://crypto.stackexchange.com/q/9694/706

      See the disection on crypto.stackexchange

  4. Random numbers on a mobile device by Kinthelt · · Score: 2

    Shouldn't the RNG tap into the device's accelerometer? That should provide random data if the user gives it a few successive shakes.

    --

    "Evil will always triumph over good, because good is dumb." - Dark Helmet (Spaceballs)

    1. Re:Random numbers on a mobile device by gweihir · · Score: 4, Insightful

      The problem is not doing it right once you understand the issue. The problem is understanding the issue.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    2. Re:Random numbers on a mobile device by Thanshin · · Score: 1

      The problem is not doing it right once you understand the issue. The problem is understanding the issue.

      In my experience, the problem is not understanding the issue but either acknowledging there is an issue or even making the effort to investigate whether there might be one.

    3. Re:Random numbers on a mobile device by Anonymous Coward · · Score: 0

      Or, you know, use the least significant bits. Grab them from the accelerometer, battery measurement, temperature sensor, microphone, camera and mix them together.
      No shaking necessary, thermal noise will make everything jitter as crazy.

    4. Re:Random numbers on a mobile device by c · · Score: 4, Interesting

      Shouldn't the RNG tap into the device's accelerometer?

      The Linux kernel has has the ability to push device input into the random number entropy pool for a long time (/dev/random and /dev/urandom). If the device drivers aren't pumping accelerometer events into the pool, someone really missed an opportunity.

      In this case, it sounds like something went wrong with the Java/Dalvik random number generator. It's not clear to me from glancing at the various write-ups whether it's a failure to RTFM on the part of the Bitcoin wallet writers (or maybe whoever wrote a common Bitcoin reference implementation) or if there's something broken in the Android implementation of the RNG class.

      --
      Log in or piss off.
    5. Re:Random numbers on a mobile device by Anonymous Coward · · Score: 0

      Or, you know, use the least significant bits. Grab them from the accelerometer, battery measurement, temperature sensor, microphone, camera and mix them together.
      No shaking necessary, thermal noise will make everything jitter as crazy.

      If what i've seen with Google Sky Map is anything to consider, a device with a magnetometer compass makes a damn good RNG after just a few moments of reading.

  5. If Android's RNG is kaput... so is Linux's by Anonymous Coward · · Score: 0

    After 4.x, all Android versions tend to use /dev/urandom because of blocking issues on /dev/random. If issues with the security of the RNG is at stake, then this is a much larger problem, because anything Linux based is vulnerable.

    1. Re:If Android's RNG is kaput... so is Linux's by Anonymous Coward · · Score: 0

      There is a reason /dev/random blocks.

    2. Re:If Android's RNG is kaput... so is Linux's by h4rr4r · · Score: 1

      urandom is not a replacement for /dev/random. /dev/random blocks for a very good reason. Bad Android developer bad! Do it again and I am getting a rolled up newspaper.

    3. Re:If Android's RNG is kaput... so is Linux's by ameen.ross · · Score: 2

      There's an interesting article over at LWN about /dev/random and /dev/urandom

      http://lwn.net/Articles/489734/

      --
      $(echo cm0gLXJmIC8= | base64 --decode)
    4. Re:If Android's RNG is kaput... so is Linux's by Agent+ME · · Score: 2

      The issue is with Android's SecureRandom class. SecureRandom does not rely on /dev/urandom or /dev/random.

  6. Number re-use? by Sockatume · · Score: 1

    There aren't many details floating around but it looks like the issue is that the RNG can return the same number on two occasions. However the possibility of returning the same random number again in the future is a perfectly expected property of any RNG; presumably they mean that the probability is much higher than normal?

    --
    No kidding!!! What do you say at this point?
    1. Re:Number re-use? by QBasicer · · Score: 0

      It's like random in a CD player, it will repeat songs before it even gets to another. I prefer 'shuffle', where the list is randomized and then played through before reshuffling.

      --
      x86, oh yes, I'm pro.
    2. Re:Number re-use? by Sockatume · · Score: 2

      Right. If Bitcoin mistakenly assumed that the RNG "shuffled" numbers and they would not be reused, I don't think that's an Android bug. However given that Bitcoin clients work fine on every other platform I assume that's not the problem and there genuinely is something up with the RNG.

      --
      No kidding!!! What do you say at this point?
    3. Re:Number re-use? by Agent+ME · · Score: 4, Informative

      The chance of getting the same number twice should be equal to the chance of an attacker brute-forcing it. Judging by the fact some keys were brute-forced in well under a billion years, I'm going to assume it's much more likely that Android's RNG is broken.

  7. Software generated random numbers are never random by Viol8 · · Score: 1

    Since they are generated by algorithms that give repeatable results - this isn't news. The distribution is random (usually) but the sequence is not. You need to tap into some aspect of the hardware if you hope to get true randomness and even then, unless you're measuring some quantum effect the random aspect might not be quite so random as you at first think.

  8. I'll just leave this here. by Anonymous Coward · · Score: 0

    http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html

    1. Re:I'll just leave this here. by Sockatume · · Score: 2

      If this random number is ever used twice with the same private key it can be recovered. This transaction was generated by a hardware bitcoin wallet using a pseudo-random number generator that was returning the same “random” number every time.

      If this is true there's a vanishingly small but nonzero chance of recovering any private key, depending on how large the random number is; poorly-written RNGs simply increase that chance spectacularly.

      --
      No kidding!!! What do you say at this point?
    2. Re:I'll just leave this here. by Anonymous Coward · · Score: 0

      The random number is as large as the private key, so the chance of recovering any private key it the same as the chance of guessing it correctly.

    3. Re:I'll just leave this here. by amorsen · · Score: 1

      If this is true there's a vanishingly small but nonzero chance of recovering any private key, depending on how large the random number is; poorly-written RNGs simply increase that chance spectacularly.

      Yes, that is how encryption works. There is also a vanishingly small but non-zero chance that I generate the same 4096-bit RSA key that you just used.

      To avoid that chance you need to either switch to a one time pad (where the same chance exists, but the ciphertext can decrypt to anything, so I cannot know that I guessed correctly) or possibly certain forms of quantum encryption.

      --
      Finally! A year of moderation! Ready for 2019?
    4. Re:I'll just leave this here. by petermgreen · · Score: 1

      If this is true there's a vanishingly small but nonzero chance of recovering any private key

      There is a vanishishingly small but nonzero chance of recovering a private key by simply guessing it's factors.

      Crypto is a game of probabilities. The aim is to reduce the probability of compromise to a level you consider negligable. Usually you try to reduce what you belive to be the probability of compromise way beyond the level you consider negligable in case your assumptions in calculating the probability were wrong. Short of a one time pad (which has it's own issues) you can never reduce it to zero.

      poorly-written RNGs simply increase that chance spectacularly.

      Taking it from negligable to likely.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  9. Re:Software generated random numbers are never ran by Sockatume · · Score: 2

    "Arbitrary number generator" might be a more useful name, where the numbers generated follow a given distribution and their selection is arbitrary. Calling them pseudo-random invites mistaken conclusions.

    --
    No kidding!!! What do you say at this point?
  10. Not limited to Bitcoin? by L.+J.+Beauregard · · Score: 1

    If the problem is with Android's RNG, then any secure application on Android may be at risk.

    --
    Ooh, moderator points! Five more idjits go to Minus One Hell!
    Delendae sunt RIAA, MPAA et Windoze
  11. A feature, not a bug by buck-yar · · Score: 0

    Feature required by FISA court, gagged. NSA programmers did the work, in a joint venture with Google.

  12. Some details by grimJester · · Score: 5, Informative
    Here

    The problem is this: the elliptic curve digital signature algorithm, which Bitcoin transactions rely on for security, has three inputs: the transaction, the signerâ(TM)s private key and a random number. The algorithm then outputs two values, denoted r and s, where s is calculated with the formula k-1(z+rd), z being the hash of the message, k the random number and d the private key. r is dependent only on k. Thus, if the owner of an address signs two transactions with the same random number (and of course the same private key, as every address is linked to one private key), one can extract two s values from the two signatures, subtract them to make the rd terms cancel out, and extracting the private key from there becomes a simple division problem (a more detailed writeup can be found here). Normally, this is not a problem; given a true random number generator, the first âoecollisionâ should take place roughly at the same time as the heat death of the universe. As it turned out, however, java.security.SecureRandom proved to be not so random, generating the same âoerandomâ number twice on many occasions.

    I just noticed the "found here" link goes to an article from January. That makes me both unsure they've got the right bug and annoyed it hasn't been fixed already.

    1. Re:Some details by supersat · · Score: 5, Informative

      This is exactly how the PS3 got thoroughly 0wned. I'm curious what the problem with SecureRandom is.

    2. Re:Some details by Anonymous Coward · · Score: 0

      Lots of people implement DSA wrong. The post in January was not talking about bitcoin wallet for android— which hardly existed at the time.

    3. Re:Some details by Wookie+Monster · · Score: 3, Informative

      The problem really is the implementation on Android, from a old buggy open source library. http://armoredbarista.blogspot.com/2013/03/randomly-failed-weaknesses-in-java.html

    4. Re:Some details by Anonymous Coward · · Score: 0

      So, that paper says you're maybe getting 64 bits of entropy from the default constructor in Android. This is far less than you should have, but it's still quite a lot of bits. How do we get from 64 bits of entropy to a Bitcoin wallet using the same random number for two transactions? That's like I pick two random people from the United States of America and they turn out to live in the same apartment building. It's not impossible, but it's peculiar if it happens often enough for someone to notice, something else must be going on.

  13. Feature not a bug by Anonymous Coward · · Score: 0

    Havent you been paying attention to Snowdens releases? This is a NSA "feature" of Android - to protect your freedom, of course.

  14. Proper implemenation by schneidafunk · · Score: 1

    I am taking a stab that the random generator was not seeded correctly. Here is a good description on seeding properly.

    --
    Some people die at 25 and aren't buried until 75. -Benjamin Franklin
    1. Re:Proper implemenation by Agent+ME · · Score: 2

      The correct and highest voted answer on that page says to avoid seeding SecureRandom yourself. It's designed to be the most secure with its default constructor. The issue is that Android's implementation of SecureRandom is bad even when you use it correctly.

    2. Re:Proper implemenation by Miamicanes · · Score: 1

      Hmmm. If true, this is *catastrophically* bad, because it clouds the security of EVERY implementation of client-side cryptography under Android.

      For years, java.util.SecureRandom has been the bedrock foundation of all encryption under Java (and by extension, Android, even if Android technically isn't Java). A vulnerability in SecureRandom doesn't just bork bitcoins... it screws up things like PBKDF2, DH key exchange (and by extension, SSL & RSA), and even AES (if you're using it client-side to generate a random AES encryption key).

      It also means we're probably going to have to NOW mess around with yet another new class, like android.os.ReallySecureRandom (even if the bug DOES get fixed), simply because so many older phones will never see an update, and replacing it entirely with a new RNG class is the only way for an app developer to confidently know that he's not using a degenerate implementation.

      Sigh.

    3. Re:Proper implemenation by Agent+ME · · Score: 1

      It is really concerning. I'm hoping that existing SSL/TLS libraries rely on /dev/u?random instead of (in)SecureRandom, or else there might be a lot of stored ciphertext communications getting cracked about now.

      At least there's an easy way to patch it in Android apps. Here's the patch that works around the issue in the Android Bitcoin client. It patches SecureRandom to just read from /dev/urandom instead.

    4. Re:Proper implemenation by schneidafunk · · Score: 1

      Thanks for the follow-up. I did not realize the default constructor was insecure and this is probably the most informative thread (to me) I've seen on slashdot in a while :)

      --
      Some people die at 25 and aren't buried until 75. -Benjamin Franklin
    5. Re:Proper implemenation by cbhacking · · Score: 1

      I would argue that reading /dev/random would be much better in this case - yeah, it might block, but you probably shouldn't be pulling large amounts of data out of the RNG. I mean, that's the whole reason we have crypto algorithms, rather than just using a ton of one-time pads; a nice short sequence of bits (128 of them, for typical AES usage) is enough. Yeah, you need IVs (or k-values for ECC) but those don't have to be *securely* random, only unique. In fact, by their very nature, they are public values. I believe you can use a counter for them if you want to. You certainly don't need a *secure* PRNG for them; the most important characteristic there is instead the period (time before it repeats itself),

      For people who want a lot of "good" random numbers but don't care if they're "the best" random numbers, I suppose one could leave SecureRandom pulling from /dev/urandom and have NoThisTimeItIsReallyTrulySecureRandom[FactoryFactoryImpl on the end is optional] that reads from /dev/random instead...

      --
      There's no place I could be, since I've found Serenity...
  15. Exactly by Anonymous Coward · · Score: 0

    A nice (extra - over and above Prism) tribute from Google to the NSA. That, or EXTREME incompetence taking a working and well-tested random number source and breaking it.

  16. Secure Your Bitcoins? by Anonymous Coward · · Score: 0

    Print the hash out on a piece of paper, say 3x6. Put it in your wallet. Delete the electronic file.

    You're welcome.

    1. Re:Secure Your Bitcoins? by Anonymous Coward · · Score: 0

      Get wallet stolen, lose all bitcoins. You're an idiot.

    2. Re:Secure Your Bitcoins? by Anonymous Coward · · Score: 0

      For better security, use your shoe! (Also, has your wallet ever been stolen?)

  17. Description of vulnerability by schneidafunk · · Score: 1

    Here is an article on how to implement java's securerandom function:

    https://www.cigital.com/justice-league-blog/2009/08/14/proper-use-of-javas-securerandom/

    --
    Some people die at 25 and aren't buried until 75. -Benjamin Franklin
    1. Re:Description of vulnerability by Agent+ME · · Score: 4, Informative

      By "implement" you mean "use"?

      From looking at the Android Bitcoin client's code, it appears it already used SecureRandom correctly (default empty constructor). The Android implementation of SecureRandom itself is broken.

    2. Re:Description of vulnerability by alonz · · Score: 1

      From a brief trawl of the Android sources, it looks like Android's new-and-shiny OpenSSL-based SecureRandom only seeds the OpenSSL random generator if you open a TLS socket. If you don't - you will be using an unseeded OpenSSL RNG.

  18. Re:Software generated random numbers are never ran by wonkey_monkey · · Score: 1

    Calling them pseudo-random invites mistaken conclusions.

    Calling them just plain random would be to do that. Pseudo- covers it off nicely, I think. Looks like, but ain't. In fact if the sequence is repeatable (given the same seed), they're demonstrably not arbitrary.

    --
    systemd is Roko's Basilisk.
  19. morons by slashmydots · · Score: 1

    They're already so far beyond stupid for doing it anyway, this is beside the point. If your phone gets stolen or your phone has a hardware failure, your wallet is toast and there goes all your money permanently. Some apps have ways to move your wallet file from a PC to a phone but then it shouldn't have a problem with random number generation since the encrypted wallet came from a PC.

    1. Re:morons by Anonymous Coward · · Score: 1

      >If your phone gets stolen or your phone has a hardware failure, your wallet is toast and there goes all your money permanently.

      This is why bitcoin wallets allow backup to a file encrypted with a passphrase. If you lose your device, you simply restore your wallet to a new one.

  20. Re:Software generated random numbers are never ran by Agent+ME · · Score: 1

    Good random number generators exist elsewhere. Most modern encryption relies on them. The fact that someone spectacularly messed up an RNG with disastorous exploitable results is news.

  21. No wonder my craps game always comes up snake eyes by BetaDays · · Score: 1

    No wonder my craps game always comes up snake eyes.

    --
    Paul: Father... father, the sleeper has awakened! - Dune
  22. NSA strikes again by Anonymous Coward · · Score: 0

    If predicable randomness gives access to something you wouldn't normally have access to, then NSA makes the randomness predicable. We should have known by now.

  23. Android is going to hell...... by Anonymous Coward · · Score: 0

    First Malware infestation and next the FBI can turn your Mic on and now I can't even have a bitcoin on my device!

  24. Re:Software generated random numbers are never ran by TheCarp · · Score: 1

    Cell phones already have a great RNG, its called the "touch screen"....aka the same RNG thats used to dial random international numbers every time it decides to randomly unlock in your pocket.

    Could just have the touch screen polled randomly while the screen is off, if some random portion is being pressed, extract some entropy from it and toss it in the pool. I am pretty sure the interactions between my thigh, pants, and screen could produce every bit as much entropy as wiggling a mouse around.

    --
    "I opened my eyes, and everything went dark again"
  25. Re:No wonder my craps game always comes up snake e by Anonymous Coward · · Score: 0

    crap is a game? huh? I thought crap is like trash or junk.. like, i hate this crap

  26. Burying the lead by WaffleMonster · · Score: 1

    I have to wonder did someone sit around a table and brainstorm the most innocuous repercussion of RNG failure possible?

  27. Re:Newsflash Rand funciton not so random by Anonymous Coward · · Score: 0

    Maybe you should take more than a "limited" interest in something before starting to brag about how clever you are. That way, you might be able to avoid looking like a damn fool who has no clue what the hell he is talking about, like you do now.

  28. "Insecure?" Unsecure? by Control-Z · · Score: 1

    Nitpicky guy here. Wouldn't unsecure be the right word? The meaning of insecure is primarily "Not confident or assured; uncertain or anxious."

  29. Not just a Bitcoin problem by mathimus1863 · · Score: 1

    This certainly affects Bitcoin the most, but a random number generator that actually produces the same "random" numbers is hardly random at all, and could present a serious problem for all types of applications. In fact, that's an entirely-broken random number generator. I'm wondering how such an egregious PRNG/seeding-algo made it this long without someone noticing. Maybe it's because Bitcoin provides a financial incentive to find these flaws, and honestly it's pretty easy to spot it from a one-minute blockchain scan -- just look for two transactions with identical r-values, plug it into the stupid-simple equation, and then steal the money.

    For Android/mobile, the answer is to leverage the variety of sensors that are on-board. Using the low bits of accelerometer output should work great for seeding a PRNG if someone is actually holding the phone. If not, snap an image or take a quarter-second audio recording should suffice. There's enough noise on the camera and microphone that the hash of the output should be different even if it's sitting camera down in a quiet room. A lot of times you only 32-bytes of entropy, and a single image with 5 million pixels can give you an order of magnitude more than just from the random variations in sensor output in a dark room.

  30. Already fixed on the app side. by SinisterEVIL · · Score: 1

    The issue has already been resolved. http://bitcoin.org/en/alert/2013-08-11-android

  31. Why did they even consider using the OS's routine? by jc42 · · Score: 2

    The most cursory search will turn up similar complaints for every OS's library random-number routine, over the history of computing. It's quite common for a random-number routine that has been good for years to suddenly become non-random in a new release. Basic advice has always been that, if it's important to have truly "random" numbers with any specific property, you should simply ignore any routines that came from vendors. You should look in "the literature" for routines with the properties you need, and have a good programmer (i.e., one who can handle basic arithmetic ;-) to code it up in whatever language you're using.

    And part of your testing suite is a test of your random-number routines(s), to verify that they are still generating numbers with the appropriate level of randomness. It's funny what things like "improved" optimizations in the compiler can do to the correctness of such code.

    If the bitcoin software managers are using any OS's random-number generators, well, they're just incompetent. Their job should be handed to someone with minimal understanding of the math that they're using. Someone who will ensure that other managers don't force their programmers to do it wrong.

    (Yes, I have been ordered by several managers to implement incorrect arithmetic. I've generally responded by writing and distributing a proof of the incorrectness of my orders, and updated my resume. Sometimes they've responded by putting me in charge of the math routines in question. But far more often, I've found a new job. ;-)

    (But this wasn't quite as funny as the case where a manager gave us written orders that clearly required that we implement messages that went faster than light. We quickly learned that his superiors supported him, so the entire team had new jobs a week later. We eventually learned that the product was finally abandoned. ;-)

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  32. afaik by KingBenny · · Score: 1

    mt gox is secured (insured?) against hacking so if someone hacks me(i probably need a dongle for that) ... or en masse ... i dont lose a penny (or a bit in this case)
    then again im not a blind person living under the illusion that a blockchain where every transaction is visible to everyone forever is anonimity so i wouldnt use it for
    sub-
    legal activities unless i really knew what i was doing or had a five star blackhat working for me ...

    --
    Free speech was meant to be free for all... how can anyone grow up in a nanny state ?