10 ms·
Croc: Easily and securely send things from one computer to another
- rauhl 6y agoThe author has a blog post at https://schollz.com/blog/croc6/ https://schollz.com/blog/croc6/ with more information. I would like to see a security analysis. The code phrases seem ludicrously short to me …
- spurdoman77 6y agoQuickly looking, the word list is 1626 words, which means 1626^3 = 4 billion combinations. I don't know how it works in practice but I would guess the initial sending communication is always quite short-timed...
- ThreeFx 6y ago4 billion is about 32 bits of security, which is most definitely not enough.
- bscphil 6y agoIt can be enough for PAKE. Depends on what your requirements are. Edit: to be more specific: 32 bits means that an attacker has a 1 / 4294967296 chance of guessing your password. They do not get multiple tries, because that's not how PAKE works. It's akin to agreeing with someone that you will meet in the park and exchange a short secret phrase to prove your identities, whereupon you will exchange GPG keys with each other or whatever. You don't need 128 bits of security for the "meeting in the park" exchange, any short unguessable phrase will do.
- phonebucket 6y ago> an attacker has a 1 / 4294967296 chance of guessing your password One attacker has that chance for one transfer. But if the service is popular, then it's perfectly feasible that typing in som random choice intercepts some arbitrary file belonging to someone.
- bscphil 6y agoThat's right. But you'd have to attack an extraordinary number of transfers to have even a small chance of managing to get one by luck, and an attack of that scale would very quickly become obvious since everyone would have their transfers interrupted. I agree with you in principle though, I'd like to see just a bit more entropy.
- lioeters 6y ago> a bit more entropy The appropriate use of "bit" here made me smile.
- Dangeranger 6y agoIncreasing the passphrase to four words would bring the odds up to 1 / 6,990,080,303,376. In magic-tunnel I believe there is a flag to change the number of words used by default. It appears that schollz/croc allows you to use your own passphrase, but not increase the default word size, that would be a good feature request.
- bscphil 6y agoYou're quite right, of course, but keep in mind that magic-wormhole is using a much smaller wordlist, and in fact only has 1 / 65536 odds by default. The people writing software in this space don't seem to believe this is a credible threat.
- psanford 6y agoYou can use whatever string you want as the passphrase for Magic Wormhole, the receiver just won't get tab completion.
- Dangeranger 6y agoHow would tab completion work in a situation like this? Are the clients exchanging information about the passphrase over the same communication channel?
- 6y ago
- bscphil 6y agoThe way it works is that the code phrases are use to do a key exchange (PAKE), which means that the only way they're useful to an adversary is if someone is able to MITM your connection and guess the passphrase. The presumption is that this is unlikely enough that you should see a bunch of incorrect passwords and abort, knowing something is wrong, before someone is able to successfully MITM you. I admit I'd rather see a longer default passphrase too, but fortunately this is adjustable on the sender's end of the connection, so you can choose a longer one if you'd like.
- codeulike 6y agoWait, how does the receiver find the sender, just via the passphrase? How does that work? Is there a relay server and if so how do sender and reciever know who the relay is?
- bscphil 6y agoGood question. My impression of it is that it's a little janky at present, compared to Magic Wormhole. Yes - there's a relay server, but you don't have to trust the relay. (As of changes made in March - before that Croc sent the key in the clear to the relay.) The first three characters of the passphrase are used to establish a shared channel between the sender and receiver, and the rest of the key is used to do a PAKE, which is a secure method for key exchange. The default passphrase is only three words long, and according to another comment the wordlist is only 1626 words, so you should assume the first word of the keyphrase is entirely blown and useless for securing you from the relay. So that makes the space effectively 1626^2 = 2.6M passwords. To MITM you the relay would have to guess which of those passwords is correct. Magic Wormhole works a bit differently. IIRC it dynamically requests a channel from the server which is prepended to the passphrase as a number. This seems a bit more resilient to me, as the birthday problem suggests it's quite likely two people will end up with the same channel just by bad luck with Croc. Edit: indeed, a test forcing similar passwords beginning with the same three characters completely screws Croc up. I can do "croc send -c 'xyz blahblahblah' filename" on multiple computers without error, but croc receives go to the first channel even if they have the wrong password. Edit: There are only ~900 different three letter word beginnings in the wordlist, so you'd only need to claim that many channels on the server to make it unusable for anyone who lets Croc pick passwords, and occasional collisions between users are certain. Lol that should probably be fixed.
- qrv3w 6y ago> "croc send -c 'xyz blahblahblah' filename" on multiple computers without error That seemed to be a bug and is fixed now. After two parties enter a channel it should give you a "room is full" response. > Magic Wormhole works a bit differently. IIRC it dynamically requests a channel from the server which is prepended to the passphrase as a number. This seems a bit more resilient to me, as the birthday problem suggests it's quite likely two people will end up with the same channel just by bad luck with Croc....There are only ~900 different three letter word beginnings in the wordlist, so you'd only need to claim that many channels on the server to make it unusable for anyone who lets Croc pick passwords, and occasional collisions between users are certain. Lol that should probably be fixed. I think wormhole uses only 99 channels [1] so it is also susceptible to a DOS attack. But generally, collisions in channels can occur but are probably pretty rare because I don't have enough people using croc simultaneously to collide. Importantly - colliding channels doesn't undermine security because you have to have the whole passphrase to successfully perform PAKE. But, when you say it should probably be fixed, you refer to mitigating a DOS attack? [1]: https://github.com/warner/magic-wormhole/issues/107 https://github.com/warner/magic-wormhole/issues/107
- bloak 6y agoSince no one else seems to have mentioned the obvious XKCD: https://xkcd.com/949/ https://xkcd.com/949/ Does anyone know why it uses 5 ports (9009-9013)?
- wscott 6y agocroc's author leads with that in the real description for this program: https://schollz.com/blog/croc6/ https://schollz.com/blog/croc6/
- qrv3w 6y agoThe first port is for communication, the four other ports are for transferring data in parallel. You can setup a relay to use only two ports (one for comm, one for transfer) but in general I found that the parallel transfer give a little speed-up.
- amoe_ 6y agoCan anyone clarify the claim of 1.5-4x speedup over rsync? Does this also apply for data that's already compressed? If so, how is it achieved?
- emilfihlman 6y ago>Does this also apply for data that's already compressed Of course not, but there are ways like multiple connections and threading (preventing blocking or slow io) that might increase throughput considerably, but normally? Nah.
- bscphil 6y ago> Does this also apply for data that's already compressed? Assuming that rsync runs close to line speed on your computer, then a 1.5x speed up would be by definition impossible for already-compressed data. Moreover, rsync already offers compression, so any improvement would have to be from multiplexing. Maybe that does get 1.5x on some connections, but I'd be skeptical until I saw some real data.
- qrv3w 6y agoThe claim is wrong, I didn't know about the rsync compression (-z option, wish it was defaulted). I ran a test using the rsync compression and rsync transferred a little bit faster (~4% faster). croc is faster than wormhole last couple times I tried though. I'll update the readme.
- deleted 6y ago[deleted]
- jwr 6y agoThis is so badly needed… There is no reasonable alternative to AirDrop, which has a number of problems, and is Mac-only.
- zimpenfish 6y agoI use Syncthing for this kind of transfer involving non-Macs although that's because I'm always transferring between a set of known hosts, not ad-hocly. Works well enough.
- em-bee 6y agosyncthing is great, but i find it a bit difficult to use for one-off or one-way transfers
- mmwelt 6y agoSnapdrop[1] works quite well if you're on the same network. It's cross platform, you only need a reasonably recent web browser. [1] https://snapdrop.net/ https://snapdrop.net/
- ljoshua 6y agoI pine for the days of drop.io to return before it was acquired and dropped (BA-dum PSH!). That was, hands down, the best and easiest way to get files from one place to another.
- spieglt 6y ago
- fredley 6y agoThis seems very similar to Magic Wormhole which I've been using for years: https://github.com/warner/magic-wormhole https://github.com/warner/magic-wormhole. I'll admit the crocs README sells it better though.
- wscott 6y agothe author's blog post on Croc credits magic-wormhole: magic-wormhole has most everything (currently its missing capabilities for multiple file transfers and file resuming), but it requires installing lots of the Python ecosystem which is tricky for non-developers (and Windows users).
- dathinab 6y agoWasn't the magic wormhole author working on a new version which isn't python based?
- tyingq 6y agoHe has a "work in progress" repo that's a Rust port of magic wormhole, here: https://github.com/warner/magic-wormhole.rs https://github.com/warner/magic-wormhole.rs Looks like it's been idle for 5 months.
- tptacek 6y agoThere's an interoperable Golang Magic Wormhole, "wormhole-william", which works quite well.
- anyfactor 6y agoThis is just too simple to believe.
- gverrilla 6y agoI know very little about malware, but I tried clicking at @yakczar at the bottom of the page where it says "by all means you can send an Issue, a PR, ask a question, or tweet me (@yakczar)." and my antivirus software stopped me saying it was a potential threat (trojan). It points to domain ctt . ec (don't know if safe), different from all other usernames (github/). Seems to me there's something wrong, right?
- bscphil 6y agoThis appears to be a link shortener service provided by "click to tweet dot com", which prefills some information into a Tweet for you to tweet at the author. It seems to be a convenience thing. Chances are your antivirus software is a little over-cautious and some malware has at some point used the link shortener.
- air7 6y agoHow does the relay server work? As in, does the developer maintain and fund it out of pocket? That seems to me to be quite costly.
- qrv3w 6y ago> How does the relay server work? Basically the relay server is a dumb switchboard. It waits for a connection to established with an identifier. When two connections with the same identifier are found, the relay server pipes the data between them. Security is ensured by having each connection to the relay use PAKE. Once the two clients connected via the relay they establish their own communication securely using PAKE, so neither the relay (nor anyone else) can decipher the transfer. If you use croc locally, you actually don't use the public relay as the two clients can automatically discover themselves with peer discovery. [1] > does the developer maintain and fund it out of pocket? That seems to me to be quite costly. Yes, I've maintain it and funded it out of pocket for a few years. Recently, I've gotten Github sponsor support that helps. [2] It's not too costly. [1]: https://github.com/schollz/peerdiscovery/ https://github.com/schollz/peerdiscovery/ [2]: https://github.com/sponsors/schollz https://github.com/sponsors/schollz
- tptacek 6y agoIt's not clear to me how this differs from Magic Wormhole, which is in wide use already. If it's a Golang implementation of the idea, there's already an interoperable Golang Magic Wormhole: https://github.com/psanford/wormhole-william https://github.com/psanford/wormhole-william.
- nopcode 6y agoFrom the developer’s own blog post: magic-wormhole has most everything (currently its missing capabilities for multiple file transfers and file resuming), but it requires installing lots of the Python ecosystem which is tricky for non-developers (and Windows users)
- tptacek 6y agoFrom my very own comment: there's already an interoperable Golang Magic Wormhole
- qrv3w 6y agoI was inspired by wormhole to make croc. croc does not use the wormhole spec. I found it necessary to diverge from the wormhole spec so I could easily implement features that I find important. AFAIK I've* implemented features in croc that are still not available in wormhole, including: - resuming transfers [1] - ipv6 support [2] - local transfer without public relay [3] - simple installation for windows [4] - sending folders without zipping (i.e. send in place) [5] *some features, like ipv6 support, were generously tested/coded/inspired by others. [1]: https://github.com/warner/magic-wormhole/issues/88 https://github.com/warner/magic-wormhole/issues/88 [2]: https://github.com/warner/magic-wormhole/issues/354 https://github.com/warner/magic-wormhole/issues/354 [3]: https://github.com/warner/magic-wormhole/issues/48 https://github.com/warner/magic-wormhole/issues/48 [4]: https://github.com/warner/magic-wormhole/issues/208 https://github.com/warner/magic-wormhole/issues/208 [5]: https://github.com/warner/magic-wormhole/issues/58 https://github.com/warner/magic-wormhole/issues/58
- shigawire 6y ago>simple installation for windows [4] To me this is the killer feature. It's not terrible to transfer files between different dev computers - the users probably have the understanding or software to make that happen. It is really hard to send your mom large files.
- tealpod 6y agoI made a similar tool HelloEle which allows to upload/download files with file-indexes. You can connect it to any AWS S3 API compatabile bucket (ex: AWS buckets, BackBlaze...) HelloEle.com https://github.com/prakis/helloele https://github.com/prakis/helloele
- skratlo 6y agoThis is tech from alternative reality where we're not forced to use Teams, GApps and other shit. It's a reality where you "croc" a screencast via shareable croc URL, posted via matrix chat to your manager.
- StartupTree 6y agoI've been using Croc recently and it's been rock solid, and exactly what I'd been looking for. Thanks to the author.
- qrv3w 6y agoThanks, I appreciate that :)