LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-23-2023, 11:17 AM   #1
zpekter
LQ Newbie
 
Registered: Nov 2023
Posts: 5

Rep: Reputation: 1
Question Can we decrypt a file system using older version of EncFS


Hi All,

Can we decrypt a file system using an older version of encfs than that was encrypted?

I have a specific scenario where the encryption was done by using the encfs 1.9.5 version and the decryption needs to be done by using encfs version 1.7.4.

Does this scenario work?

Details:

Encrypted directory info from EcFS 1.9.5

Quote:
Version 6 configuration; created by EncFS 1.9.5 (revision 20100713)
Filesystem cipher: "ssl/aes", version 3:0:0 (using 3:0:2)
Filename encoding: "nameio/block", version 4:0:0 (using 4:0:2)
Key Size: 256 bits
Using PBKDF2, with 243692 iterations
Salt Size: 160 bits
Block Size: 4096 bytes, including 16 byte MAC header
Filenames encoded using IV chaining mode.
File holes passed through to ciphertext.
Encrypted directory info from EcFS 1.7.4

Quote:
Version 6 configuration; created by EncFS 1.7.4 (revision 20100713)
Filesystem cipher: "ssl/aes", version 3:0:0 (using 3:0:2)
Filename encoding: "nameio/block", version 3:0:0 (using 3:0:1)
Key Size: 256 bits
Using PBKDF2, with 117782 iterations
Salt Size: 160 bits
Block Size: 4096 bytes, including 16 byte MAC header
Filenames encoded using IV chaining mode.
File holes passed through to ciphertext.
Please share your thoughts.
Thanks

Last edited by zpekter; 11-23-2023 at 11:20 AM. Reason: Adding more information
 
Old 11-23-2023, 01:10 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
What did you try and what was the result?
 
Old 11-23-2023, 08:37 PM   #3
zpekter
LQ Newbie
 
Registered: Nov 2023
Posts: 5

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by NevemTeve View Post
What did you try and what was the result?
I've created a volume using 1.9.5
Code:
/usr/local/bin/encfs.195 -S --public /root/encfs/new/encrypted /root/encfs/new/decrypted

df -h
Filesystem                        Size  Used Avail Use% Mounted on
devtmpfs                          3.8G     0  3.8G   0% /dev
tmpfs                             3.8G  320K  3.8G   1% /dev/shm
tmpfs                             3.8G  8.7M  3.8G   1% /run
/dev/mapper/vgroup1-root          9.6G  8.0G  1.2G  88% /
/dev/sda1                         240M  199M   29M  88% /boot
tmpfs                             777M     0  777M   0% /run/user/0
encfs.195                         9.6G  8.0G  1.2G  88% /root/encfs/new/decrypted
Then when I tried to mount the same volume using a different version, 1.7.4, it's giving me the below error message.
Code:
/usr/bin/encfs.174 -S --public /root/encfs/new/encrypted /root/encfs/new/decrypted
02:05:13 (FileUtils.cpp:416) Archive exception: XML start/end tag mismatch - uniqueIV
02:05:13 (FileUtils.cpp:365) Found config file /root/encfs/new/encrypted/.encfs6.xml, but failed to load
Creating new encrypted volume.
Please choose from one of the following options:
 enter "x" for expert configuration mode,
 enter "p" for pre-configured paranoia mode,
 anything else, or an empty line will select standard mode.
?>
 
Old 11-23-2023, 09:38 PM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
This suggests incompatibilty, though the error message about the xml-file sounds in-plausible. Use xmllint two validate the file, or compare files created with different versions of the program.
 
Old 11-23-2023, 10:28 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Did you unmount it before the second attempt ?.
 
Old 11-24-2023, 12:17 AM   #6
zpekter
LQ Newbie
 
Registered: Nov 2023
Posts: 5

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by NevemTeve View Post
This suggests incompatibilty, though the error message about the xml-file sounds in-plausible. Use xmllint two validate the file, or compare files created with different versions of the program.
There are no issues with the XML file or formatting. However, the error message says that the format is not valid. I'm suspecting the below difference is causing this issue.
1.9.5
Code:
Key Size: 256 bits
Using PBKDF2, with 243692 iterations
1.7.4
Code:
Key Size: 256 bits
Using PBKDF2, with 117782 iterations
 
Old 11-24-2023, 12:18 AM   #7
zpekter
LQ Newbie
 
Registered: Nov 2023
Posts: 5

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by syg00 View Post
Did you unmount it before the second attempt ?.
Yes, I did unmount it. And I do have the backup of the data, however, I need to figure out a way to make it work.
 
Old 11-24-2023, 08:15 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
I reproduced the problem:
Code:
# encfs.174 -S --public /root/encfs_test/encr_01/ /root/encfs_test/mount_01/
15:10:47 (FileUtils.cpp:411) Archive exception: XML start/end tag mismatch - uniqueIV
15:10:47 (FileUtils.cpp:360) Found config file /root/encfs_test/encr_01/.encfs6.xml, but failed to load
Mind you, the start/end tags are valid in the XML:
Code:
# xmllint -noout encr_01/.encfs6.xml
<no error message>
# grep uniqueIV encr_01/.encfs6.xml
        <uniqueIV>1</uniqueIV>
 
Old 11-24-2023, 08:39 AM   #9
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
It might work, if creation time you use 'expert' mode, and select a file-name-encoding algorithm compatible with the older version (e.g. 4:Stream); also you have to remove this line from the .xml fájl:
Code:
<plainData>0</plainData>
Of course all of this is plain wrong, you should create the encrypter filesystem with the old version of encfs.
 
Old 11-24-2023, 02:34 PM   #10
zpekter
LQ Newbie
 
Registered: Nov 2023
Posts: 5

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by NevemTeve View Post
It might work, if creation time you use 'expert' mode, and select a file-name-encoding algorithm compatible with the older version (e.g. 4:Stream); also you have to remove this line from the .xml fájl:
Code:
<plainData>0</plainData>
Of course all of this is plain wrong, you should create the encrypter filesystem with the old version of encfs.

Thank you for this suggestion.
It seems this will solve the issue for the time being so I'm planning to use this method to make things work.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mutt unable to decrypt emails "Could not decrypt PGP message" frddbbbl Linux - Software 3 07-25-2019 10:48 AM
Hide encfs file-systems from being show in file manager. I tried using 99-hide-disks angel'le Linux - General 0 02-18-2013 04:44 AM
Need to match older machine to an older version of Linux fredb47 Linux - Distributions 10 10-27-2011 11:08 AM
[SOLVED] EncFS failure (NFS export of a reverse encfs mount) Skaperen Linux - Software 2 04-29-2011 01:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration