{"action":"created","issue":{"url":"https://api.github.com/repos/iancoleman/bip39/issues/33","repository_url":"https://api.github.com/repos/iancoleman/bip39","labels_url":"https://api.github.com/repos/iancoleman/bip39/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/iancoleman/bip39/issues/33/comments","events_url":"https://api.github.com/repos/iancoleman/bip39/issues/33/events","html_url":"https://github.com/iancoleman/bip39/issues/33","id":191364398,"number":33,"title":"using shuffled cards loses entropy","user":{"login":"dooglus","id":573356,"avatar_url":"https://avatars.githubusercontent.com/u/573356?v=3","gravatar_id":"","url":"https://api.github.com/users/dooglus","html_url":"https://github.com/dooglus","followers_url":"https://api.github.com/users/dooglus/followers","following_url":"https://api.github.com/users/dooglus/following{/other_user}","gists_url":"https://api.github.com/users/dooglus/gists{/gist_id}","starred_url":"https://api.github.com/users/dooglus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dooglus/subscriptions","organizations_url":"https://api.github.com/users/dooglus/orgs","repos_url":"https://api.github.com/users/dooglus/repos","events_url":"https://api.github.com/users/dooglus/events{/privacy}","received_events_url":"https://api.github.com/users/dooglus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-23T19:44:51Z","updated_at":"2016-12-19T04:36:54Z","closed_at":"2016-12-19T03:28:12Z","body":"A recent [reddit post](https://www.reddit.com/r/Bitcoin/comments/5am3vn/what_is_more_secure_bitaddress_bulk_wallet_or/dacn830/) caused me to notice how you're generating entropy from cards, and how it is throwing away some entropy.\r\n\r\nThe last 12 or so cards in a full 52 card shuffled deck have no effect on the generated seed because of this code:\r\n\r\n    // Calculate the new value by scaling the original value down\r\n    var withoutReplace = entropyInt.multiply(maxWithoutReplace).divide(maxWithReplace);\r\n\r\nThe `entropyInt` is made by spacing all the individual cards out equally (log(52) bits per card), but the 'scaling' will effectively chop off the end of the string, allowing only the first N cards to have any effect on the outcome. Rather than scaling like this, where only the leading bits affect the outcome, I would use an SHA-2 hash of all the bits and take the first N bits of the result, so that all the input bits affect the outcome."},"comment":{"url":"https://api.github.com/repos/iancoleman/bip39/issues/comments/267880334","html_url":"https://github.com/iancoleman/bip39/issues/33#issuecomment-267880334","issue_url":"https://api.github.com/repos/iancoleman/bip39/issues/33","id":267880334,"user":{"login":"dooglus","id":573356,"avatar_url":"https://avatars.githubusercontent.com/u/573356?v=3","gravatar_id":"","url":"https://api.github.com/users/dooglus","html_url":"https://github.com/dooglus","followers_url":"https://api.github.com/users/dooglus/followers","following_url":"https://api.github.com/users/dooglus/following{/other_user}","gists_url":"https://api.github.com/users/dooglus/gists{/gist_id}","starred_url":"https://api.github.com/users/dooglus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dooglus/subscriptions","organizations_url":"https://api.github.com/users/dooglus/orgs","repos_url":"https://api.github.com/users/dooglus/repos","events_url":"https://api.github.com/users/dooglus/events{/privacy}","received_events_url":"https://api.github.com/users/dooglus/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T04:36:54Z","updated_at":"2016-12-19T04:36:54Z","body":"Also, I wonder if it's worth pointing out on the page that the algorithm used to create the seed from the supplied entropy isn't yet set in stone.\r\n\r\nI can imagine someone using a deck of cards as their backup, \"knowing\" that your tool will always be able to regenerate their BIP39 seed words from the order of the deck if they need it. Changing how the supplied entropy is converted to a BIP39 seed will break his assumption."}}
{"actor":{"display_login":"dooglus"}}