Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: netnomad on April 13, 2011, 09:50:12 PM

Title: encrypted backup - problem to restore it
Post by: netnomad on April 13, 2011, 09:50:12 PM
i succeeded in creating an encrypted backup, but although i tried different boot options, i am not able to restore it.
my configuration:
usbstick installation 3.5.1 with two partitions: tce on /dev/sda2 with lable tc

one of my boot-codes
tinycore usbwait=5 restore=tc/tce protect

although there is a /mnt/sda2/tce/mybackup.tgz.bfe the prompt asks me two times for the encryption password.
the backup-bfe-file is not used and the restore-option over the gui-panel-application doesn' t work.

it would be great, if you could give me a hint.
thanks.
Title: Re: encrypted backup - problem to restore it
Post by: roberts on April 14, 2011, 06:38:19 PM
See: http://forum.tinycorelinux.net/index.php?topic=9148.0
Title: Re: encrypted backup - problem to restore it
Post by: netnomad on April 15, 2011, 09:19:01 AM
thanks, i' ve got it.

is there a way to encrypt the mydata.tgz.bfe manually, just for the case that i need a file or just want to look in the uncrypted tgz-package?

i get this error-message, although i used the right password (it's not a kmap problem!):
tc@box:~$ bcrypt mydata.tgz.bfe
Encryption key:
Invalid encryption key for file: mydata.tgz.bfe

is the command-line bcrypt different to the protect-mode-bcrypt?
Title: Re: encrypted backup - problem to restore it
Post by: netnomad on April 15, 2011, 01:50:20 PM
is it possible to encrypt mydata.tgz.bfe (protected backup) with bcrypt on the command-line?
Title: Re: encrypted backup - problem to restore it
Post by: roberts on April 15, 2011, 02:31:59 PM
To encrypt mydata.tgz from command line use:

bcrypt -c mydata.tgz

You will be prompted to enter pass phrase twice.
Output will be mydata.tgz.bfe

To un-encrypt:

bcrypt -c mydata.tgz.bfe

You will be prompted for the pass phrase

To see how I did this via a script look at /usr/bin/filetool.sh
 
Title: Re: encrypted backup - problem to restore it
Post by: netnomad on April 15, 2011, 02:56:07 PM
thank you for your hint, i did not use the -c option yet.
yes, i' m also able to encrypt and un-encrypt files on the command-line, i've used it in different contexts....

my problem is to un-encrypt the mydata.tgz.bfe that was encrypted by the protected mode, in the automatic backup.
i read the /usr/bin/filetool.sh and i see that it should work, but perhaps there is a difference to use the same command in the script or as the user tc:staff on the command line!?

thank you for every new hint.
Title: Re: encrypted backup - problem to restore it
Post by: redwolf on April 12, 2012, 01:48:57 AM
Quote
although there is a /mnt/sda2/tce/mybackup.tgz.bfe the prompt asks me two times for the encryption password.
the backup-bfe-file is not used and the restore-option over the gui-panel-application doesn' t work.

it would be great, if you could give me a hint.


I had trouble figuring this out too.  Turns out wrapping my password in quotes did the trick:

Code: [Select]
tc@box:/tmp/mydata$ bcrypt -c mydata.tgz.bfe
Encryption key: <-- THIS TIME I ENTERED MY KEY NORMALLY (i.e. MYSECRETKEY)
Invalid encryption key for file: mydata.tgz.bfe
tc@box:/tmp/mydata$ bcrypt -c mydata.tgz.bfe
Encryption key: <-- THIS TIME I ENTERED MY KEY WRAPPED IN QUOTES (I.e. "MYSECRETKEY")
tc@box:/tmp/mydata$ ls
mydata.tgz*