Basic self_encryptor example DIY instructions

Pretty good text editor for Rust; here’s instructions on including Rust into Sublime Text 3 - if anyone gets stuck somewhere trying to get this up, feel free to PM me; :sunny:

1 Like

Thanks @BenMS (and recusively to @dallyshalla [and recusively to all the contributor])

The timing is perfect, we can play around with self_encryption just before the Rust 1.0 Launch Party + SAFE meetup http://www.meetup.com/projectsafemtl/events/222335185/ at the Bitcoin Embassy. :slight_smile:

There is just one little thing that bugs :bug: me…
I’m sure that MaidSafe will provide a suitable FSF or OSI license but i only see the Commercial License.

1 Like

Errors from first build attempt… dropping them here, in case they are useful.

I don’t know what stage we are at but I just tried this for fun with
VM: Linux Orange 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:30:01 UTC 2014 i686 athlon i686 GNU/Linux
using
rustc 1.1.0-nightly (9ecc9896d 2015-05-10) (built 2015-05-11)
and also then moved to
rustc 1.0.0-beta.4 (850151a75 2015-04-30) (built 2015-04-30)
and get build errors:

orange@Orange ~/self_encryption $ cargo run --example basic_encryptor – -e /media/sf_VMSharedFolder/linuxmint-17.1-mate-32bit.iso
Compiling byteorder v0.3.9
Compiling gcc v0.3.5
Compiling strsim v0.3.0
Compiling rustc-serialize v0.3.14
Compiling regex v0.1.30
Compiling libc v0.1.7
Compiling rust-crypto v0.2.31
Compiling time v0.1.25
Compiling rand v0.3.8
Compiling docopt v0.6.64
Compiling cbor v0.3.6
Compiling tempdir v0.3.4
Build failed, waiting for other jobs to finish…
failed to run custom build command for rust-crypto v0.2.31
Process didn’t exit successfully: /home/orange/self_encryption/target/debug/build/rust-crypto-daa25690d0c0b110/build-script-build (exit code: 101)
— stdout
TARGET = Some(“i686-unknown-linux-gnu”)

This is the same error that was met by MakkaPakka earlier in this thread. The workaround which worked for him and me was to define the following export:
export CFLAGS=“-mmmx -msse”
(for example in .bashrc file)

There may be other ways to define C compilation flags in a rust project but I don’t know how.

2 Likes

So, I got it working for small files but had trouble with a large file…
I had htop running in another terminal and watched as the memory filled up before falling over. My virtual machine has 1789MB Memory available and seemed to fall down at ~1200MB with error:

 Running `target/debug/examples/basic_encryptor -e /media/sf_VMSharedFolder/linuxmint-17.1-mate-32bit.iso`

! chunk_store_test AlreadyExists
Process didn’t exit successfully: target/debug/examples/basic_encryptor -e /media/sf_VMSharedFolder/linuxmint-17.1-mate-32bit.iso (signal: 4)

That’s obviously a simple 1.5GB iso image. I wonder the file isn’t being split in a way a limited memory can handle.

Also two minor points experienced.
Repeating encryption on a file suggests
“Chunk written” rather than what I’d expected would be “Chunk exists”
also it suggests x4 chunks written, where only x3 appear in the chunk_store_test/.

I saw error trying cargo update

A Cargo.lock must exist before it is updated

solution to that is

cargo generate-lockfile

:+1:

This is a part of the roadmap for the lib in the README (using nmap and clean up code). At the moment we are not bothering as it’s an easy enough fix but as is allows us to get the rest of the network up and running. More on this very soon, some big changes this week again as you will see in the update :smile:

3 Likes

I really can’t take statements like this man! F5… F5… F5…

4 Likes

as David explained we are currently not bothered about improved memory management and simply load everything into memory. This makes that execution of self_encryption can take up to 3 times the file size in memory. (as a rough upper boundary)

This is fixed now awaiting CI to merge, should be an hour or so now.

1 Like

Please change to reflect the repo changes if it matters?

git clone GitHub - maidsafe/self_encryption: file self encryptor

2 Likes

just wanted to let you know: works like a charm =) (ubuntu 14.04lts 64bit)
my poor - a little bit older - laptop was busy for a while with the 100MB Archive I tested :smiley: … but everything seems to work perfectly well

… a little bit surprising to me was that the all-in-all file-size didn’t increase … i expected with encryption file-size should explode a little bit because of some overhead being generated :open_mouth: impressive that this doesn’t happen at all
(and i’m getting more and more excited about these DIY examples :smiley: )

4 Likes

I’m looking forward to when it can walk through multiple files and folders, to test this more and see the effect of multiple files relative to single large archives.

2 Likes

I am sure somebody will do a wee app that does exactly this, if not we should perhaps update the command line example to walk full trees. They are only cmd line as examples so these libs have no gui dependencies for builders until they decide what they want. Perhaps on of us will knock together a wee dir walker. It would remove duplicate content if you have any.

Attempting now. came to an issue at 5 and being told to run command with verbose. Will continue forth…

Very excited and grateful for open source methods the forum in support of SAFE is presenting, allowing the access of truth to the people. So fun and full of utility, powerful opportunity to pollinate the world as better place.

:smile:

1 Like

Yes, we hope it’s cool :wink: At least bits of stuff flying out to the wild is a nice way to proceed to full launch. It shows hard work and also results which is very nice for everyone.

The rust install has changes since launch of version 1 so now it is

curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly

1 Like

“Rust is ready to roll.” though still >> “To learn more, run the command again with --verbose.” I will work on this a bit prior to responding again. Thank You @dirvine!

If I encrypt two files, the second file’s data_map appears to overwrite the existing data_map.

Given that the encrypt doesn’t ask for a data_map filename, I was expecting that the next file’s detail would be appended to the data_map and both then could be called for from the same data_map… but aware that didn’t quite make sense, as the filename is perhaps not important or unique for that to work.

Should there not be a data_map name field in the encrypt command?.. or will than not be needed later on?

1 Like

To make it an app then of course you are correct. We should perhaps document what the example show a bit better. This is an expected outcome. It’s an easy change to make it smart, for instance to create a ghost dir with the datamap being each filename, containing the datamap only. Then traverse and open up each file, it should be invisible to users they are opening datamaps and see it as just files.

3 Likes

The first thing i did was change it to create “filename.map” files. Was an easy change. I’ll look it up when I get to my computer.

2 Likes

Thanks. It will be simple to spawn filename.map if those are just the related data_map but I don’t know, if within the XOR space if there’s expecting to be a directory structure and if that is exactly one form of directory and file-naming convention or another. If you have two different files with the same filename, surely there’s a difference in calling to them.

I’m happy to wait and see the next round of examples or testnet etc; it just wasn’t clear atm and so I can’t plow ahead trying random tests.

1 Like