9 ms·
Author here. I've tried to keep the article as apolitical as possible, while giving some context to provide the setting. Anyway, I'm very interested in knowing
by kilburn 9y ago
Author here. I've tried to keep the article as apolitical as possible, while giving some context to provide the setting.
Anyway, I'm very interested in knowing if the used crypto is sound or not, and stirring a discussion around possible alternative approaches.
Ask me anything if you want to know further!
- diggan 9y agoAlternative approach: Instead of using the IPFS2HTTP gateways (that can easily be censored, as gateway.ipfs.io has already been censored in Catalunya), run a IPFS daemon locally that cannot be censored (but is not anonymous either). I live in Catalunya and wrote this tool for doing just that, in a easy way. It 1) starts a go-ipfs daemon locally, 2) opens up the referendum website in your default browser, via localhost. If you're interested in accessing the website from inside Catalunya, give it a try: https://git.io/vdGUx https://git.io/vdGUx
- kodablah 9y ago> that cannot be censored I am not familiar with IPFS internals, but is there no pattern to the IPFS traffic that the ISPs can shape/block? Too bad about the entire IPFS domain being blocked, because besides the host, HTTPS traffic has safety in numbers. If only there was a way to proxy through google.com or some other popular domain too important to block.
- deleted 9y ago[deleted]
- TeMPOraL 9y agoThey'd have to block it close to endpoints, because IPFS is a P2P system.
- kodablah 9y agoI don't think that's tough if a country has said you need to be able to filter traffic. Assuming it is a simple pattern (e.g. whatever their NAT busting bootstrap is), set of ports, etc they could easily push filter rules to their downstream network devices if the law makes them.
- toomuchtodo 9y ago> If only there was a way to proxy through google.com or some other popular domain too important to block. Host IPFS nodes with http proxies on GCP and point the domain with multiple A records at those instances?
- confounded 9y agoThis is basically how Signal avoid being blocked in (IIRC) Saudi Arabia.
- samstave 9y agoMore info please
- SEJeff 9y agoYup. The magic term for others to google is "domain fronting". Here is a bit more info: http://www.geektime.com/2016/12/23/signal-updates-protect-those-in-egypt-and-uae-from-state-censors/ http://www.geektime.com/2016/12/23/signal-updates-protect-th...
- confounded 9y agoAh, too late to edit, but it was Egypt and the United Arab Emirates (apologies).
- zardo 9y agoIPFS is P2P and very delay tolerant. It can run on a sneaker-net.
- tonyztan 9y ago> If only there was a way to proxy through google.com or some other popular domain too important to block. There is. Domain fronting is used in China to circumvent the Great Firewall. The concept you are talking about is collateral freedom. https://en.wikipedia.org/wiki/Domain_fronting https://en.wikipedia.org/wiki/Domain_fronting https://en.wikipedia.org/wiki/Collateral_freedom https://en.wikipedia.org/wiki/Collateral_freedom
- lgierth 9y agoThanks for mentioning domain fronting! It's also been used by Signal to circumvent communications censorship in Egypt [1]. We want to bring domain fronting to IPFS by making libp2p's websockets transport capable of it. [2] Fun fact: advanced networking setups like domain fronting are impossible to address in a URL/URI scheme. Check out multiaddr :) [3] A domain-fronted service could be addressed as something like `/dns4/google.com/tcp/443/tls/sni/google.com/http/example.com/ws` [1] https://signal.org/blog/doodles-stickers-censorship/ https://signal.org/blog/doodles-stickers-censorship/ [2] https://github.com/libp2p/libp2p/issues/18 https://github.com/libp2p/libp2p/issues/18 [3] https://github.com/multiformats/go-multiaddr https://github.com/multiformats/go-multiaddr
- tylersmith 9y agoYou can help with the anonymity with the Tor transport. We created it to enable OpenBazaar nodes to use our network over Tor. https://github.com/OpenBazaar/go-onion-transport https://github.com/OpenBazaar/go-onion-transport
- couchand 9y agoI tried to go get your project, but got a bunch of "unrecognized import path" errors. Looks like you're pulling a dependency off of IPFS, do I need to set something up for that to work correctly?
- lgierth 9y agoYou're likely missing gx, the package manager used by IPFS and many projects in its community. Try: go get github.com/whyrusleeping/gx go get github.com/whyrusleeping/gx-go cd your-project/ gx install go build // or whatever you were doing :)
- panarky 9y ago> Catalan officials can just distribute the hash of the main page file, and everyone else can be sure that all content linked from that file has been published by the catalan authorities. How does the hash of the main page guarantee that content linked from that page is authentic?
- QML 9y agoIf the Spanish government wants to redirect or modify the contents of the page, then you would get a different hash than the one provided by Catalan officials.
- euyyn 9y agoHow do IPFS links work, such that modification of what they point to modifies the hash of the document where the link is?
- acover 9y agoThere are two types of links in ipfs. Static content that works by hash of the content. Dynamic content that is signed by the owner of the bucket.... I think I haven't looked at it for months
- drabiega 9y agoIPFS is immutable and hash addressed, so 'modifying' something yields a new address. Existing documents that point to the modified thing will still point to the old version, unless their links change as well. Effectively, sharing a hash address to the main page is sharing a snapshot of the site.
- mcguire 9y agoIt's essentially the same technique as git.
- tylersmith 9y agoYou use IPNS to give a static name and change the root hash of that name when you update content.
- mattj1 9y agoNice summary! Definitely an interesting use case, the first real world practical application for IPFS that I've seen.
- alwillis 9y agoPerhaps you missed it when IPFS was used to make the Turkish version of Wikipedia available after the Turkish government blocked access the Wikipedia website: http://observer.com/2017/05/turkey-wikipedia-ipfs/ http://observer.com/2017/05/turkey-wikipedia-ipfs/
- red_admiral 9y agoThe crypto is far from ideal. The situation is very similar to password storage, where you want to not make it trivial to brute-force moderate-entropy passwords even if your database gets breached. We have functions designed specifically for that: scrypt, argon2 etc. https://www.npmjs.com/package/scryptsy https://www.npmjs.com/package/scryptsy is a pure JS implementation of scrypt for example. Even with scrypt the situation is not great, but using sha for this kind of thing is no longer state of the art. If people are willing to (a) download and run a program rather than rely on the browser and (b) willing to wait half a minute or so for the result then you could easily tune the scrypt/argon parameters up to 11 but at the cost of quite a bit in the way of usability. If "must work on smartphones without extra app downloads" is a requirement you're pretty limited in what you can do this way. Another solution might be to use real servers but host them on the "dark web" - get Tor a bit of publicity in Catalunya! EDIT: in response to a few posts that briefly appeared and then disappeared again - IPFS is fine. SHA256 for authenticating a page is fine. I'm only objecting to using raw SHA-anything as a key derivation function as in the section "A static database".
- timthelion 9y agoI'm not sure what you mean by "the crypto is not ideal"? I was under the impression that there are not yet collisions for SHA-256 https://github.com/ipfs/faq/issues/22 https://github.com/ipfs/faq/issues/22 Only for SHA-1 (which has 160 bit hashes) https://en.wikipedia.org/wiki/SHA-1#Attacks https://en.wikipedia.org/wiki/SHA-1#Attacks
- red_admiral 9y agoThe attack mentioned on the page is brute-forcing someone's details from partial information: "it can be used to “fill the gaps” of information about any citizen. If you know someone’s birth date and the area where they live, you can obtain their government ID by trial-and-error on that website." The mitigation is slowing down the number of guesses/second that an attacker can try. In a well-designed key derivation function, an attacker with 100x the resources should only be able to try out guesses 100x as fast. That's what scrypt/argon2/bcrypt/PBKDF2/... try and achieve. SHA and other general-purpose hash functions tend to be easy to parallelize, at least in parts, and you can get huge speedups on GPUs or even better, FPGAs/ASICs. That's why no-one serious still mines bitcoins on CPUs and the big mining syndicates [hire planes](http://uk.businessinsider.com/cryptocurrency-miners-rent-boeing-747s-2017-7 http://uk.businessinsider.com/cryptocurrency-miners-rent-boe...) to ship GPUs a little bit faster. This has nothing to do with collisions. It's to do with hash functions being designed to be fast, and key derivation functions are designed to be slow and memory-hard.
- geofft 9y agoOut of curiosity, where on the actual website is the crypto code? (It's way harder to follow than your simplified version :) ) Also how are they distributing the initial hash - physical signs? I figure the easiest threat from Spain is to get people to show up to the wrong polling stations, which don't have them on the voter rolls, and then cast doubts on the validity of a referendum that has a huge number of provisional ballots. Since you don't actually need to staff polling stations, this attack only really requires a single person setting up a cloned website and distributing a different hash (although it gets easier if e.g. the postal service is willing to help you send out the wrong hash).
- kilburn 9y agoThe code is in the bundled file at [1] (look for the "calcular" function). The hash was distributed in URL form through twitter by both the Catalan president [2] and the catalan economy minister (who is the 2nd in command actually) [3]. [1] https://ipfs.io/ipns/QmZxWEBJBVkGDGaKdYPQUXX4KC5TCWbvuR4iYZrTML8XCR/js/bundleV9.js https://ipfs.io/ipns/QmZxWEBJBVkGDGaKdYPQUXX4KC5TCWbvuR4iYZr... [2] https://twitter.com/KRLS/status/911482634789953536 https://twitter.com/KRLS/status/911482634789953536 [3] https://twitter.com/junqueras/status/913010751429840896 https://twitter.com/junqueras/status/913010751429840896
- enriquto 9y agobeing a catalan expat with some expertise in computers, is there any useful way that i can help this weekend? (I am not afraid of losing anonymity nor being condemned or prosecuted by the spaniards, I actually would find it rather amusing.)
- KuiN 9y agoI'd be interested in any way to help out too. As part of the Scottish independence movement, our Catalonian counterparts are comrades & allies. Other than solidarity protests over here, I'd love to help in some way.
- lottin 9y agoJust expressing your solidarity is more than enough. It seems silly but it really gives us strength and determination.
- KuiN 9y agoRadical Independence Scotland and friends will be outside the Spanish embassy in Edinburgh, all of Sunday; we absolutely support your right to self determination as the Catalans did during our recent bids for independence. Solidarity, comrade.
- gerdesj 9y agoIts a funny old world mate (I'm English) and I despise seeing censorship like this. I will also see what I can find in my toy box to assist Catalunya in expressing themselves democratically. (I would rather GB stayed in one piece but if push came to shove, I'd probably do the same here in similar circumstances - there is no excuse for this heavy handed nonsense)
- KuiN 9y agoIt's not often I find myself agreeing with a UK unionist but it's a point of honour that the Scottish referendum 2014 passed off largely as an orderly point of democracy. Westminster is often seen as heavy-handed North of the border but everyone is proud of that expression of democracy (however there are still words to be had about subsequent political events!).
- amongwhales 9y agofyi: Advantages is misspelled as advanta(d)ges in Paragraph ~6 under "A website stored in IPFS" Thanks! This is a great read
- kilburn 9y agoI actually thought it was spelled that way :S Corrected, thank you!
- tbatchelli 9y agoThis is a very interesting real world use of IPFS. Is this the first real world & large scale use of it? So far it seems it is delivering on its promise: I was able to find my voting station. Too bad I am a continent and and ocean away from home :(
- kordlessagain 9y agoThanks for the article. After reading it, I went and added an IPFS node to my Kubernetes deployment on Google Cloud and then mapped the /ipfs and /ipns endpoints through Kong so they would be served by https://api.wisdom.sh/<ipfs|ipns>/ https://api.wisdom.sh/<ipfs|ipns>/. This effectively gives people yet another domain they can use which doesn't require installing the IPFS client. Any IPFS site wil work through the proxy, but here's the site under discussion: https://api.wisdom.sh/ipns/QmZxWEBJBVkGDGaKdYPQUXX4KC5TCWbvuR4iYZrTML8XCR/en/index.html https://api.wisdom.sh/ipns/QmZxWEBJBVkGDGaKdYPQUXX4KC5TCWbvu... If anyone wants the scripts I used to build up the system, let me know. Here's the Kubernetes YAML I used: https://gist.github.com/kordless/5625ae8abf3d3f14dd3f9c9d500c7b86 https://gist.github.com/kordless/5625ae8abf3d3f14dd3f9c9d500...
- HarfTarf 9y agohttps://ipfs.github.io/public-gateway-checker/ https://ipfs.github.io/public-gateway-checker/ It would be nice to add your gateway to the list.
- unkown-unknowns 9y agoIt took a very long time to load the page. Consider implementing some caching if you haven't already.
- kordlessagain 9y agoI think it's because the named version is being used (ipns) which may or may not be involving a lot of requests to the network to resolve (perhaps to the main node even). I've resolved and pinned the original content here: https://api.wisdom.sh/ipfs/QmXj5GjZ8WApwq79EyAeNZ2E6pQkJmbrjC84usQL24D41d/en/index.html https://api.wisdom.sh/ipfs/QmXj5GjZ8WApwq79EyAeNZ2E6pQkJmbrj...
- ajnin 9y agoYou say "the code recurses a sha256 computation 1714 times to get a password for decryption, and then once more to get the lookup key", however in the code above the search string is computed as var search = sha256(key);, note it's using key and not passkey, which means, assuming that is correct, only one round of sha256, so roughly 1715 times faster to crack. It seems weird that the sensitive part (ID number + birth date + post code) would be encrypted the most weakly, and the public part (voting station) would be encrypted the most strongly. Maybe I'm reading this wrong or the code author involuntarily made his encryption quite weaker.
- kilburn 9y agoThe text was right, but I made a mistake writing key there when it should have been passkey. It is fixed now, thank you for noticing!
- carlesm 9y agoAlthought crypto is not hard to beat, specially knowing some user data, that is not also an issue. The only information you would get by knowing some of that data is where somebody is supposed to vote. An information you can already infer from the Zip code. There are, at most, four possible voting sites for each zip code. In some (several) small/medium villages there is only one voting site, so, not to much to learn from decrypting. Besides, the census (voting places) information is usually (in normal elections), placed (via paper printed listings) on voting places. And there there is more information (full name, for example).
- setzer22 9y agoThis may have been stated already, but the DNI final character is a control one, it can be computed from the characters and the algorithm is well-known. So there should be no need to brute-force it.
- vanderZwan 9y agoIronically, your website is blocked the the network of my university: https://imgur.com/a/fJxvX https://imgur.com/a/fJxvX
- pmarreck 9y agoI love this story. Just wanted to say that.