Overwrote keyfile; Have master key; Recover data?
Hello,
So I was bumbling along and for some stupid reason I generated a new keyfile (thinking I was on another machine) and ended up overwriting my keyfile that I use on a volume that has 1.1TB data.
I was reading
https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#6._Backup_and_Data_Recovery
section 6.10, and at the time I had the thing unlocked. So I retrieved the master key as described in the FAQ, but then I guess I didn't read the instructions properly, and did luksFormat with the master key file. When I unlock that, the filesystem that's supposed to be inside doesn't exist.
What I did: http://sprunge.us/UjBQ
I also have http://sprunge.us/bWFc from my console buffer when I was just playing around. Is data recovery still possible?
Thank you,
Zack Buhman
Quoted 14 lines · Zack Buhman
Hello,
So I was bumbling along and for some stupid reason I generated a new keyfile (thinking I was on another machine) and ended up overwriting my keyfile that I use on a volume that has 1.1TB data.
I was reading
https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#6._Backup_and_Data_Recovery
section 6.10, and at the time I had the thing unlocked. So I retrieved the master key as described in the FAQ, but then I guess I didn't read the instructions properly, and did luksFormat with the master key file. When I unlock that, the filesystem that's supposed to be inside doesn't exist.
Quoted 4 lines
What I did: http://sprunge.us/UjBQ
I also have http://sprunge.us/bWFc from my console buffer when I was just playing around. Is data recovery still possible?
From a quick look, I think you problem may be simple, namely other defaults. Good job keeping the info, but you will need to make a new container after recovery, as your master key is now publicly known and your data not secure anymore.
As the FAQ states, you need to create the new LUKS container with the same parameters as the old one.
Lets see, you have:
0 7813523456 crypt aes-xts-plain bff82...76d4 0 9:127 4096
^^^^^^^^^^^^^ ^^^^^^^^^^^^
cipher+mode keyA test with a loop file on my system gives:
0 200704 crypt aes-cbc-essiv:sha256 9d....35 0 7:0 4096
Your old container does not use the defaults of the cryptsetup sources, but the ones used by some distribution or parameters set by yourself.
Make sure the new header is also aes-xts-plain, by dumping the master key again. The key and cipher parameter need to be the same, otherwise decryption will not work.
The other thing is that I think you should try this without keyfile, exactly as described in the FAQ section 6.10. Not sure whether it makes a difference (I have never used keyfiles), but your master key is compromised anyways, a keyfile will not help.
Arno
Signature · 6 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: [email protected] GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F ---- One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision. -- Bertrand Russell
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Arno Wagner
but you will
need to make a new container after recovery, as your master key is now publicly known and your data not secure anymore.
Nope; I flipped a few characters around ;P
Quoted 10 lines
Lets see, you have:
0 7813523456 crypt aes-xts-plain bff82...76d4 0 9:127 4096^^^^^^^^^^^^^ ^^^^^^^^^^^^ cipher+mode keyA test with a loop file on my system gives:
0 200704 crypt aes-cbc-essiv:sha256 9d....35 0 7:0 4096Your old container does not use the defaults of the cryptsetup sources, but the ones used by some distribution or parameters set by yourself.
Funny thing is, I was the one who specfied aes-xts-plain.
Quoted 4 lines
Make sure the new header is also aes-xts-plain, by dumping the master key again. The key and cipher parameter need to be the same, otherwise decryption will not work.
THAT'S IT! It works! Thank you very much Dr. Wagner; I can't tell you how grateful I am of you stating what should have been the obvious.
Thanks again,
Zack Buhman
Quoted 7 lines · Zack Buhman
Quoted 4 lines · Arno Wagner
but you will
need to make a new container after recovery, as your master key is now publicly known and your data not secure anymore.Nope; I flipped a few characters around ;P
Smart ;-)
Quoted 13 lines
Quoted 10 lines
Lets see, you have:
0 7813523456 crypt aes-xts-plain bff82...76d4 0 9:127 4096^^^^^^^^^^^^^ ^^^^^^^^^^^^ cipher+mode keyA test with a loop file on my system gives:
0 200704 crypt aes-cbc-essiv:sha256 9d....35 0 7:0 4096Your old container does not use the defaults of the cryptsetup sources, but the ones used by some distribution or parameters set by yourself.
Funny thing is, I was the one who specfied aes-xts-plain.
Quoted 8 lines
Quoted 4 lines
Make sure the new header is also aes-xts-plain, by dumping the master key again. The key and cipher parameter need to be the same, otherwise decryption will not work.
THAT'S IT! It works! Thank you very much Dr. Wagner; I can't tell you how grateful I am of you stating what should have been the obvious.
No problem, and please call me Arno ;-)
Arno
Signature · 6 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: [email protected] GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F ---- One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision. -- Bertrand Russell