Olimex Support Forum

Others => TERES DIY Laptop => Topic started by: starkwether on February 16, 2018, 07:23:58 PM

Title: Difficulty Torrenting Teres Ubuntu Image
Post by: starkwether on February 16, 2018, 07:23:58 PM
Sorry to bother you guys but I'm trying to get a backup image of Ubuntu Mate for my Teres in the event(uality) I screw the OS up.

I've had the official torrent running for more than a day and it looks like there just aren't any peers.

Maybe there is a script to dump mmc to SD? Or just dd it? Any links to mirrors with hashsums for the zip?

Many thanks!
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: khumarahn on February 16, 2018, 07:30:39 PM
I was able to download it today. You can grab it from me
https://163.172.132.71/teres_ubuntu_mate_161117_v1_2.zip
and check it against the torrent file (for hash verification).

There is a script to install to mmc, but if you want a dump of mmc to SD, you can use for example rsync. Like
rsync -xXaAhH / /sdcard-mount-point/backup
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: starkwether on February 17, 2018, 01:21:09 AM
Weird... torrent hash specified is:

79b6f3f7544d52f7df1dabb4485def074bf89d23

Self computed sha1 of the file I got from you is:

7bc4985ef338fbaca10eb74748f784e4708ea256

They're both "teres_ubuntu_mate_161117_v1_2.zip". The heck.
Hey Olimex, could I bother you guys for a checksum for teres_ubuntu_mate_161117_v1_2.zip ?

Definitely missing that mainline crypto core support for the A64, ha  ;D
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: khumarahn on February 17, 2018, 01:43:26 AM
Strange... What is the torrent hash? Why would you think it is sha1?

You should be able to check the file against the torrent with a torrent downloader such as transmission, and it should be cryptoraphically secure.
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: starkwether on February 17, 2018, 04:48:54 AM
The torrent hash that Transmission reports is 79b6f3f7544d52f7df1dabb4485def074bf89d23. That's what I checked and posted. In Transmission its Properties > Information and it's listed right there...is that not the hash for the file?

It's SHA1 because it's 40 characters. md5 is 32 character output and SHA224, SHA256 and up are longer.

Why do people use SHA1 if it's been collision-able since 2010? :o
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: khumarahn on February 17, 2018, 05:30:55 AM
Torrents do not use normal hashes. They use Merkle trees, because then it is cheap to verify that a given downloaded piece is correct, without having the whole file.
https://en.m.wikipedia.org/wiki/Merkle_tree
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: khumarahn on February 17, 2018, 05:31:56 AM
That hash could be sha1, but not of the file.
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: starkwether on February 17, 2018, 10:48:08 PM
QuoteThat hash could be sha1, but not of the file

My mistake, you are correct. The hash Transmission specifies under Properties > Information is an "Info Hash" which is not the same as the output of sha1sum-ing the fully downloaded file.
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: starkwether on February 18, 2018, 04:45:44 AM
Quotecheck it against the torrent file (for hash verification).

So transmission-show foobar.torrent will decode a .torrent file's info, given you have transmission. Or you can use  this bash script.  (https://mywiki.wooledge.org/TorrentParser)

But there's only an infohash in that torrent file...How would you verify the integrity of a directly downloaded file just given the master .torrent file  :o
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: khumarahn on February 18, 2018, 01:04:24 PM
when you start the torrent, select as the destination directory the path where the downloaded file is. Start the torrent and wait for it to verify existing data...
Title: Re: Difficulty Torrenting Teres Ubuntu Image
Post by: starkwether on February 18, 2018, 06:23:34 PM
You are right again, the file I got from you, whose SHA1 file hash is: 7bc4985ef338fbaca10eb74748f784e4708ea256 (file hash not info hash), checks out just fine. Why didn't I think of that? Thanks for your patience, haha.