View previous topic :: View next topic |
Author |
Message |
_fr0st n00b
Joined: 01 Nov 2006 Posts: 9
|
Posted: Sun Oct 28, 2007 12:52 pm Post subject: GNUPG: Suddenly lost access to keyfile.gpg |
|
|
Hello,
A couple of days ago, I startet a process to create a new encrypted LVM-partition, and move everything I got from the regular LVM to the encrypted one. Btw, I use loop-aes to encrypt my partition.
Now, after some days, some unmounts/mounts, I suddenly gets "Error: gpg key file decryption failed" every time I try to mount.
If I try to decrypt manually with "gpg -vvv -d ./keyfile.gpg" all I get is:
-----------------------------------------------
gpg: using character set `iso-8859-1'
gpg: armor: BEGIN PGP MESSAGE
gpg: armor header: Version: GnuPG v1.4.7 (GNU/Linux)
:symkey enc packet: version 4, cipher 3, s2k 3, hash 2
salt 625d5ec3f0310439, count 65536 (96)
gpg: CAST5 encrypted data
:encrypted data packet:
length: unknown
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key
-----------------------------------------------
Now, some info about how I made this.
-emerged gnupg (using gentoo)
-maked a new random passphrase for myself with: "head -c 65 /dec/random | uuencode -m - > mypass"
-maked a keyfile for my future disk encryption: "head -c 2880 /dev/random | uuencode -m - | head -n 65 | tail -n 64 | gpg --symmetric -a > keyfile.gpg"
When asked for a password, I copy&pasted the whole text from "mypass".
Now, after using losetup to set up the encryption, filled the disk with random data with dd and blah blah blah, I was ready for use. I mounted the disk successfully with "mount -o encryption=aes256,gpgkey=/root/keyfile,loop=/dev/loop0 /dev/ftpcrypt/ftpcrypt1 /home/ftp". Also here just copy&pasted the data from "mypass" when mount asked me for pass.
Suddenly now, today, after unmounting, adding new disks to lvm, lvextended, resized with resize_reiserfs and "losetup -R", this happends. I don't think losetup/mount/lvm can have anything to do with this..
So.. Any possible solutions? May it be because I did not create a private key to pgp before starting this? I have not use pgp before, so Im a newbie..
I've tested to copy both mypass and keyfile.gpg over to other computers, no luck there either.
Oh, and one more thing: I opened my keyfile.gpg in vim, don't remember if I used ": x" or ": q" to quit.. Could vim do something with the file if I used ": x"?
And of course: I am the only one with access to this server, so my mypass file is untouched..
Thanks in advance for any help! |
|
Back to top |
|
|
tarpman Veteran
Joined: 04 Nov 2004 Posts: 1083 Location: Victoria, BC, Canada
|
Posted: Sun Oct 28, 2007 6:18 pm Post subject: Re: GNUPG: Suddenly lost access to keyfile.gpg |
|
|
_fr0st wrote: | Oh, and one more thing: I opened my keyfile.gpg in vim, don't remember if I used ": x" or ": q" to quit.. Could vim do something with the file if I used ": x"? |
You're quite possibly hosed. :x is a shortcut for :wq, which saves the file before quitting. If it tried to do anything like converting line endings on the way through, your keyfile is useless now. _________________ Saving the world, one kilobyte at a time. |
|
Back to top |
|
|
_fr0st n00b
Joined: 01 Nov 2006 Posts: 9
|
Posted: Sun Oct 28, 2007 6:52 pm Post subject: |
|
|
Excuse my language, but: F*CK!..
You probably are right. I've created some new keyfiles now, and everyone ends at 4215 bytes.. But my keyfile.gpg is 4223.. That means that I've added something.. Yeah yeah, Im learning; create a backup of gpg-files :p
Gonna check out that file, but seems that I just lost a bit over 1TB worth of data :'(
Thanks for the answer anyway! |
|
Back to top |
|
|
_fr0st n00b
Joined: 01 Nov 2006 Posts: 9
|
Posted: Sun Oct 28, 2007 6:56 pm Post subject: |
|
|
Btw, if I've managed to change the file, why don't I get any CRC errors on decrypting?
I've checked my file in a hexeditor, and all linebreaks ++ seems ok when checking it up against other gpg-files. But theres one line, the third line from the bottom, "e0noB....". This one is 32 chars long, but in all the other gpg's I've made, its only 24. Could it possibly be this line destroying my file? If I try to alter it, I'm getting CRC error.. I've tried to remove 8bytes at the time (as one string) at all 25 combinations and decrypted it with --ingore-crc-error, but no luck. Don't understand how I could have entered chars at random places at the bottom line :p But then again, don't understand how I could be stupid enough to alter this file in the first place - even if it was an accident..
iQFSctbfzLN3Ud6q6Wy6GvUBu1RvDUQ1QYSBB6xBrCulfA86kbjlu+NAcGSB+3MW
HUivDXIVRSWnxVUp+u6i+V9tRCSVQ/W+yKeOxiPOGLBYYbDZRYTtqSY2SSMMhb3j
e0NoBkWAwZFN1z6X2WAwrRTb+NkHV/4=
=ZA6d
-----END PGP MESSAGE----- |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|