<CENTER></CENTER> <BR/> First of all there is no need to panic, you are probably not affected by this bug, but I just put this out as a PSA since I have found a serious bug in the way Electrum generates it's seed but only if you generate it from the command interface. # You are **`NOT`** affected by this bug: * If you have generated your Electrum wallet / Seed, from the GUI interface. So if you use Electrum's GUI version, like probably 99% of other users do, then this bug does **`NOT`** affect you at all. * If you have generated your Electrum wallet / Seed, from the command line/terminal interface but without using the `--entropy` command <br/> # You **`ARE`** affected by this bug: * If you have used the `--entropy` command in the console/terminal, and in fact it's very probable that your wallet seed has very little entropy, in fact so little that it could be dangerous to store any Bitcoins in those wallets, since the seed can be easily guessed by a computer running all day guessing private keys, [which hackers are already doing](https://www.youtube.com/watch?v=foil0hzl4Pg). <br/> --------------------------- <br/> # Issue So the problem is with the `--entropy` command which triggers the `custom_entropy` variable and part of code, which I have already found pretty strange in my code audit: * https://steemit.com/programming/@profitgenerator/electrum-bitcoin-wallet-code-audit So I had to contact the developer to tell him about this issue, and it turns out I am right, I found a serious bug: * https://bitcointalk.org/index.php?topic=2012226.0 So if you just use the GUI Electrum, then this is of no concern to you, but it is of concern to people who like to add some extra entropy to their wallets, and who thought this is a safe way to do it, only to turn out that it's not. There are 2 issues, 1 is the quality of the user generated entropy, which is more like a user related problem, since people will just enter their birthdate or their phone number there which has 0 entropy but they think it's secure. However I guess most tech savvy people who use the console are hopefully not this dumb. But the main issue is a cryptographic issue. The part of the code in the `mnemonic.py` file: `custom_entropy * (my_entropy + nonce)` This code tries to imbue the custom entropy into that pre-generated random number by multiplying with it. I am not crypto expert but I have done my research and many experts agree that multiplying is a very shitty way of adding entropy. In fact it doesn't add entropy, it can actually lower it, because multiplication can only create [smooth numbers](https://en.wikipedia.org/wiki/Smooth_number) and not primes. So if you have a dice which has 6 outcomes and hence 2.5850 bits of entropy. If I want to add another 2.5850 bits of entropy to it, to obtain 5.17 bits, then if you multiply the numbers it will be less than that, it will be only 3.807 bits instead of 5.17 bits. Ok so it adds some entropy, but not the full amount. If we add a small block of entropy to a large one like a 1000 sided hypothetical dice (9.9658 bits) multiplied with a 6 sided dice (2.5850 bits), it should be 12.5508 bits, but in reality its just 11.5172 bits. So it looks like it doesn't destroy the large stack of entropy, but it certainly destroys the smaller stack. I write a quick python code so that you can play around with this concept: ```python import math array=[] x=1 y=1 for x in range (999): # from 0 to 999 for y in range (5): # from 0 to 5 prod=(x+1)*(y+1) # cycle through 1000 x 6 sized cycle and multiple all numbers in this range from 1 to 6000 array.append(prod) # add the product to the array fin=sorted(set(array)) # remove duplicates, since we are only interested in how many unique combinations (entropy) the multiplicator operator can give; then sort it by ascending order length=len(fin) # length of the array print fin print "length: "+str(length) print "bits: "+str(math.log(length,2)) # log2 of the length is it's Shannon entropy value ``` <BR/> So this proves that multiplication doesn't lower the total entropy below the higherst number, but it lowers the entropy of the lowest number significantly. So the Electrum script creates like a 128 bit number, if it replaces like 20 bits of the RNG with your custom entropy, which it doesn't, then that 20 bits might as well just be 10 bits, even if you generated them by yourself using a dice, simply because multiplication lowers it. Of course if you put there your phone number or your birthdate, that by definition has 0 entropy. So instead of having a 128 bit strong seed, you get something like 100 bits, which is still relatively strong, but kind of not recommended. The only way to maintain entropy is to concatenate the strings. So if you add 2 x 6 sided dice's entropy together, you do that by concatenation, not multiplication. And then the largest value becomes 66, which is 6.04439 bits, which is higher than the 5.17 bits expected, however this is only the informational size of it, it still only contains 5.17 bits of entropy. So it may be a larger informational size (because the [base 10 number system](https://en.wikipedia.org/wiki/Decimal) is inefficient), but the entropy of it will only be maximum 5.17 bits. <br/> # What to do? Well if you are not affected by it, then nothing. If you are, then you probably want to generate a new wallet, through the GUI of course or without using that `--entropy` command, and send your bitcoins there. It's not a very urgent issue, because I doubt you used more than 20 bits of custom entropy, but if you did then it is urgent, something like a 80 bit seed can already probably can be cracked by a supercomputer, or just some nerd running ASICs at home to crack people's private keys. [Remember they are already doing this](https://www.youtube.com/watch?v=foil0hzl4Pg). You know this is why it's good to know Python language and some basic cryptographic concepts, because just like that, problems can arise, so the smarter you are the easier you can handle them. I have had some math background, so it was not hard for me to understand these, but I really recommend everyone to just learn programming and some basic cryptographic knowledge, at least the concepts of entropy, make sure you understand them. It's just basic due diligence, if you want to play in the Cryptocurrency markets safely, it can definitely be an asset to know the basic concepts. ------------------------------------------ **Sources:** * Electrum software is the Copyright of Thomas Voegtlin licensed with [MIT license](https://opensource.org/licenses/MIT). * https://electrum.org ------------------------------------------- <CENTER><H1>Upvote, ReSteem & <a href="https://steemit.com/@profitgenerator" target='_blank'><img src='https://s4.postimg.org/cfz9b1mnh/bluebutton.png' border='0' alt='bluebutton'/></a></H1> </CENTER>
author | profitgenerator |
---|---|
permlink | psa-bug-with-electrum-wallet-seed-generation-vulnerability |
category | electrum |
json_metadata | {"tags":["electrum","bitcoin","security","education","mathematics"],"image":["https://steemitimages.com/DQmZudN7GeojGNuN2h8DBkGJSzweaUr4byy6bcDJc2GSrdf/electrum.png","https://s4.postimg.org/cfz9b1mnh/bluebutton.png"],"links":["https://www.youtube.com/watch?v=foil0hzl4Pg","https://steemit.com/programming/@profitgenerator/electrum-bitcoin-wallet-code-audit","https://bitcointalk.org/index.php?topic=2012226.0","https://en.wikipedia.org/wiki/Smooth_number","https://en.wikipedia.org/wiki/Decimal","https://opensource.org/licenses/MIT","https://electrum.org","https://steemit.com/@profitgenerator"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-07-13 15:13:33 |
last_update | 2017-07-13 15:13:33 |
depth | 0 |
children | 10 |
last_payout | 2017-07-20 15:13:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 2.316 HBD |
curator_payout_value | 0.410 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 7,037 |
author_reputation | 68,549,319,463,075 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 8,350,941 |
net_rshares | 665,581,959,661 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
sandra | 0 | 22,152,261,466 | 11% | ||
ihashfury | 0 | 3,198,068,874 | 2.86% | ||
jason | 0 | 10,281,981,065 | 3.96% | ||
joelinux | 0 | 42,290,372,772 | 100% | ||
angusleung100 | 0 | 2,675,714,347 | 100% | ||
michaellamden68 | 0 | 6,658,067,151 | 10% | ||
vortac | 0 | 179,707,282,444 | 5% | ||
lichtblick | 0 | 87,301,924,317 | 10% | ||
vanessavi | 0 | 3,918,119,780 | 80% | ||
sergey44 | 0 | 1,397,373,674 | 100% | ||
dumar022 | 0 | 40,288,939,083 | 20% | ||
profitgenerator | 0 | 14,024,355,813 | 100% | ||
saamychristen | 0 | 20,938,056,474 | 50% | ||
freebornangel | 0 | 2,757,777,576 | 4% | ||
rishi556 | 0 | 1,536,269,776 | 100% | ||
qagiri | 0 | 278,033,980 | 100% | ||
olga.maslievich | 0 | 27,475,920,245 | 51% | ||
teukumukhlis | 0 | 99,582,764,306 | 100% | ||
sellergenius | 0 | 887,434,134 | 25% | ||
steemitboard | 0 | 223,457,345 | 1% | ||
aismor | 0 | 528,711,810 | 100% | ||
caladium | 0 | 547,882,655 | 100% | ||
altcointrends | 0 | 1,661,131,944 | 3% | ||
live2love | 0 | 5,399,696,588 | 100% | ||
rulesforrebels | 0 | 6,578,888,352 | 100% | ||
gokulnk | 0 | 1,143,296,842 | 100% | ||
btcunchained | 0 | 66,765,754,494 | 100% | ||
hippiepyro | 0 | 626,776,621 | 100% | ||
babettxx | 0 | 1,927,385,595 | 100% | ||
krayzie29 | 0 | 170,977,073 | 100% | ||
pro20 | 0 | 244,547,670 | 100% | ||
dijital | 0 | 11,640,886,031 | 100% | ||
growlifeculture | 0 | 771,849,364 | 100% |
Thanks for the update buddy... Luckily not using electrum wallet
author | btcunchained |
---|---|
permlink | re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170713t191805697z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-13 19:18:09 |
last_update | 2017-07-13 19:18:09 |
depth | 1 |
children | 2 |
last_payout | 2017-07-20 19:18:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 64 |
author_reputation | 490,718,345,731 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,373,584 |
net_rshares | 0 |
Don't get me wrong Electrum is a very secure and very well reviewed software used by many whales. It's just this particular bug that is there, if you would use Electrum the default way through the GUI then this doesn't affect people. It only affects people who like to play around, tweak things and generate seeds the unusual way, which is why that only should be done by experts who know what they are doing. But your average users just use the GUI version, which is totally safe to use. Besides even this issue will probably get patched in the next version, so it's no big deal. People just have to be aware of things, cryptocurrencies are still largely in beta, anything can happen.
author | profitgenerator |
---|---|
permlink | re-btcunchained-re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170714t075227900z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-14 07:52:36 |
last_update | 2017-07-14 07:52:36 |
depth | 2 |
children | 1 |
last_payout | 2017-07-21 07:52:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.217 HBD |
curator_payout_value | 0.072 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 689 |
author_reputation | 68,549,319,463,075 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,429,935 |
net_rshares | 68,117,285,974 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
btcunchained | 0 | 68,117,285,974 | 100% |
Cool βΊοΈ that's for replying bro π yes the whole of cryptocurrency is a large scale experiment
author | btcunchained |
---|---|
permlink | re-profitgenerator-re-btcunchained-re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170714t101622013z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-14 10:16:24 |
last_update | 2017-07-14 10:16:24 |
depth | 3 |
children | 0 |
last_payout | 2017-07-21 10:16:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 93 |
author_reputation | 490,718,345,731 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,440,820 |
net_rshares | 0 |
Thank you very much for this information. Fortunately I'm not affected.
author | izbing |
---|---|
permlink | re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170713t151723161z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-13 15:17:24 |
last_update | 2017-07-13 15:17:24 |
depth | 1 |
children | 0 |
last_payout | 2017-07-20 15:17:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 71 |
author_reputation | 6,706,719,896,087 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,351,334 |
net_rshares | 0 |
Making the world a safer place! Good work!
author | live2love |
---|---|
permlink | re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170713t151549107z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-13 15:15:51 |
last_update | 2017-07-13 15:15:51 |
depth | 1 |
children | 1 |
last_payout | 2017-07-20 15:15:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.017 HBD |
curator_payout_value | 0.004 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 42 |
author_reputation | 343,924,648,853 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,351,181 |
net_rshares | 5,481,384,556 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
live2love | 0 | 5,481,384,556 | 100% |
Yes it was actually an accident that I have discovered it, it looks like the bad code has been there for more than 1 year now, I wonder how many people are affected by it. Well most people use the GUI electrum, but maybe some big exchanges, merchants, or large whales could have used the custom entropy command, and they could have now a vulnerable wallet.
author | profitgenerator |
---|---|
permlink | re-live2love-re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170713t152514900z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-13 15:25:36 |
last_update | 2017-07-13 15:25:36 |
depth | 2 |
children | 0 |
last_payout | 2017-07-20 15:25:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.017 HBD |
curator_payout_value | 0.004 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 356 |
author_reputation | 68,549,319,463,075 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,352,129 |
net_rshares | 5,451,122,270 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
live2love | 0 | 5,451,122,270 | 100% |
@profitgenerator Good Post! Thanks for sharing.
author | qagiri |
---|---|
permlink | re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170713t214757891z |
category | electrum |
json_metadata | {"tags":["electrum"],"users":["profitgenerator"],"app":"steemit/0.1"} |
created | 2017-07-13 21:48:00 |
last_update | 2017-07-13 21:48:00 |
depth | 1 |
children | 0 |
last_payout | 2017-07-20 21:48:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 47 |
author_reputation | 5,207,321,068,642 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,386,483 |
net_rshares | 0 |
I'm too stupid to know how I did it and if I'm in danger lol
author | rulesforrebels |
---|---|
permlink | re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170713t153657646z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-13 15:36:57 |
last_update | 2017-07-13 15:36:57 |
depth | 1 |
children | 1 |
last_payout | 2017-07-20 15:36:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 60 |
author_reputation | 13,562,276,538,272 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,353,233 |
net_rshares | 0 |
Well you use the graphical version of electrum not the console, are you? In that case this is no problem to you. If you say you are not tech savvy then you probably don't play around with the console, so this doesnt affect you.
author | profitgenerator |
---|---|
permlink | re-rulesforrebels-re-profitgenerator-psa-bug-with-electrum-wallet-seed-generation-vulnerability-20170714t074925100z |
category | electrum |
json_metadata | {"tags":["electrum"],"app":"steemit/0.1"} |
created | 2017-07-14 07:49:36 |
last_update | 2017-07-14 07:49:36 |
depth | 2 |
children | 0 |
last_payout | 2017-07-21 07:49:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.025 HBD |
curator_payout_value | 0.007 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 228 |
author_reputation | 68,549,319,463,075 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,429,684 |
net_rshares | 7,844,853,797 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
rulesforrebels | 0 | 7,844,853,797 | 100% |
Congratulations @profitgenerator! You have completed some achievement on Steemit and have been rewarded with new badge(s) : [](http://steemitboard.com/@profitgenerator) Award for the number of upvotes Click on any badge to view your own Board of Honor on SteemitBoard. For more information about SteemitBoard, click [here](https://steemit.com/@steemitboard) If you no longer want to receive notifications, reply to this comment with the word `STOP` > By upvoting this notification, you can help all Steemit users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
author | steemitboard |
---|---|
permlink | steemitboard-notify-profitgenerator-20170714t021841000z |
category | electrum |
json_metadata | {"image":["https://steemitboard.com/img/notifications.png"]} |
created | 2017-07-14 02:18:39 |
last_update | 2017-07-14 02:18:39 |
depth | 1 |
children | 0 |
last_payout | 2017-07-21 02:18:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 700 |
author_reputation | 38,975,615,169,260 |
root_title | "PSA: Bug with Electrum Wallet - Seed Generation Vulnerability!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,405,835 |
net_rshares | 0 |