cryptosave

Programming issues and discussion
Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

cryptosave

Postby Scooby » 02 May 2014, 19:01

I wrote a script that enables you to enclose a savefile(changes.fs4) in a LUKS container
for encryption.

It's supposed to be used when alphaOS is booted with fresh.
cryptosave then fools alphaOS to believe it is in usbmode and encrypted
savefile is loaded as if in usbmode. There is no automatic save but data in
RAM is saved when pressing save-session button on desktop. If alphaOS is rebooted
without performing "cryptosave d changes.img" data will be saved when OS is closing down.

Download: cryptosave.sb

The script is based on cryptobox from AUR.

To create a LUKS container:

Code: Select all

cryptosave c changes.fs4

the output will be a file called changes.img that is encrypted.
This file can be activated in alphaOS by

Code: Select all

cryptosave a changes.img


and dectivated with

Code: Select all

cryptosave d changes.img


cryptosave uses a modified /usr/bin/bundle to work
(included in cryptosave.sb)

Only thing i changed is bundle-->bundle_activate() line: 128
from

Code: Select all

exit 0

to

Code: Select all

# exit 0


and
bundle-->bundle_deactivate() line: 162
from

Code: Select all

exit 0

to

Code: Select all

# exit 0

Aspi
Advanced
Posts: 40
Joined: 21 Apr 2014, 11:32

Re: cryptosave

Postby Aspi » 03 May 2014, 13:11

tested with fresh cmdline each time.

I had error codes when cryptosave c changes.fs4, and when trying cryptosave a, I get "touch: cannot touch 'root/Desktop/savesession.desktop': _No such file or directory" and "mount: mount point /root/Desktop/savesession.desktop does not exist".

This is great for your needs, but I think I'd like to have mine mounted at early boot.

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: cryptosave

Postby Scooby » 03 May 2014, 17:03

Thanks for testing

Aspi wrote:I had error codes when cryptosave c changes.fs4

I really would like the error codes and output of this? could you post?

Maybe it was

Code: Select all

error: changes.fs4 doesn't exists


The program does not create changes.fs4. It assumes you have created one before running.

also in this version you have to cd to dir were changes.fs4 resides

could you try again and give a little more info?
was it semaphore warning? like

Code: Select all

semid 360448: semop failed for cookie 0xd4d9d05: incorrect semaphore state
Failed to set a proper state for notification semaphore identified by cookie
value 223190277 (0xd4d9d05) to initialize waiting for incoming notifications.


It seems to be a known issue of non-critical nature.
Everything should work anyway.

Aspi wrote:and when trying cryptosave a, I get "touch: cannot touch 'root/Desktop/savesession.desktop': _No such file or directory" and "mount: mount point /root/Desktop/savesession.desktop does not exist".

Seems like /root/Desktop/ directory is missing, Both errors releated to this.
fixed in new version

either download again or run

Code: Select all

 mkdir -p /root/Desktop


Aspi wrote:This is great for your needs, but I think I'd like to have mine mounted at early boot.

So you want a dialog during boot? I mean for password?

go fer it.

Aspi
Advanced
Posts: 40
Joined: 21 Apr 2014, 11:32

Re: cryptosave

Postby Aspi » 03 May 2014, 18:45

Scooby wrote:was it semaphore warning? like

Code: Select all

semid 360448: semop failed for cookie 0xd4d9d05: incorrect semaphore state
Failed to set a proper state for notification semaphore identified by cookie
value 223190277 (0xd4d9d05) to initialize waiting for incoming notifications.


That's it.

Scooby wrote:So you want a dialog during boot? I mean for password?

go fer it.

Yep. At boot: "Either know the pass, or don't boot" is the best, but in alphaOS case, only changes.fs4 encryption is needed. So, "either know the pass, or you don't get anything but a fresh system" is what I'm looking for :)

Also, I think your script may have worked. There is something strange going on: when I create changes.fs4, I can successfully boot, but after boot, I can't launch things from the taskbar, like Taeni. The only thing I can do, is Shutdown and Reboot (fortunately). I'm looking for what could be causing it.

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: cryptosave

Postby Scooby » 04 May 2014, 14:04

Aspi wrote:Also, I think your script may have worked. There is something strange going on: when I create changes.fs4, I can successfully boot, but after boot, I can't launch things from the taskbar, like Taeni. The only thing I can do, is Shutdown and Reboot (fortunately). I'm looking for what could be causing it.


by taskbar you mean tint2, right? not right click menu?

I'm not sure what you mean was it

1) tint2 stopped working after you created changes.fs4

or

2) After you ran "cryptossave a changes.fs4"

you can try doing "killall -SIGUSR1 tint2” to restart tint2 from a terminal.
To get a terminal try "windows key + t" (Super + t) key combination.

I am interested in what F***s up tint2?

Aspi
Advanced
Posts: 40
Joined: 21 Apr 2014, 11:32

Re: cryptosave

Postby Aspi » 04 May 2014, 17:25

Even Win+T does not work.

It happens by just creating changes.fs4 and saving one session to it. I modded the "save-session" script to ask me whether to save the session, and there is no problem before saving the first session.

The only thing I do different than the stock image, is GRUB. I'll have a look to what it might be. I'll prolly mod "save-session" to only preserve certain directories, not as much as it does by default.

*edit*
Okay, so maybe it was because I had created a changes.fs4 of 10M size :roll: ("save-session" should very well be checking for this :) )
It is working now, 200M savefile.


Return to “Scripting and Programming”

Who is online

Users browsing this forum: No registered users and 1 guest

cron