Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checksum missmatch - not decrypting. #502

Closed
vleonbonnet opened this issue Mar 28, 2018 · 3 comments
Closed

checksum missmatch - not decrypting. #502

vleonbonnet opened this issue Mar 28, 2018 · 3 comments

Comments

@vleonbonnet
Copy link

I am running encfs version 1.9.1. I can create a new mount point and write files to it but I am not able to open the files when i remount the folder. Tried on two different computers running slackware, they both fail and I can reproduce the issue with any type of encryption, password or folder location.

$ encfs ~/source ~/dest -f -v
2018-03-27 18:20:51,286 VER [main.cpp:548] Root directory: /home/val/source/
2018-03-27 18:20:51,286 VER [main.cpp:549] Fuse arguments: (fg) (threaded) (keyCheck) encfs /home/val/dest/ -f -o use_ino -o default_permissions 
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.
?> 

Standard configuration selected.
2018-03-27 18:20:52,646 VER [SSL_Cipher.cpp:333] allocated cipher ssl/aes, keySize 24, ivlength 16
2018-03-27 18:20:52,646 VER [FileUtils.cpp:1105] Using cipher AES, key size 192, block size 1024

Configuration finished.  The filesystem to be created has
the following properties:
2018-03-27 18:20:52,647 VER [Interface.cpp:110] checking if ssl/aes(3:0:2) implements ssl/aes(3:0)
2018-03-27 18:20:52,647 VER [SSL_Cipher.cpp:333] allocated cipher ssl/aes, keySize 24, ivlength 16
Filesystem cipher: "ssl/aes", version 3:0:2
Filename encoding: "nameio/block", version 4:0:22018-03-27 18:20:52,647 VER [Interface.cpp:110] checking if nameio/block(4:0:2) implements nameio/block(4:0)

Key Size: 192 bits2018-03-27 18:20:52,647 VER [Interface.cpp:110] checking if ssl/aes(3:0:2) implements ssl/aes(3:0)
2018-03-27 18:20:52,647 VER [SSL_Cipher.cpp:333] allocated cipher ssl/aes, keySize 24, ivlength 16

Block Size: 1024 bytes
Each file contains 8 byte header with unique IV data.
Filenames encoded using IV chaining mode.
File holes passed through to ciphertext.

Now you will need to enter a password for your filesystem.
You will need to remember this password, as there is absolutely
no recovery mechanism.  However, the password can be changed
later using encfsctl.

2018-03-27 18:20:52,647 VER [openssl.cpp:47] Allocating 41 locks for OpenSSL
2018-03-27 18:20:52,648 VER [FileUtils.cpp:1163] useStdin: 0
New Encfs Password: 
Verify Encfs Password: 
2018-03-27 18:20:56,395 VER [Interface.cpp:110] checking if ssl/aes(3:0:2) implements ssl/aes(3:0)
2018-03-27 18:20:56,395 VER [SSL_Cipher.cpp:333] allocated cipher ssl/aes, keySize 24, ivlength 16
2018-03-27 18:20:57,025 VER [Interface.cpp:110] checking if nameio/block(4:0:2) implements nameio/block(4:0)

Password used was foo.

In second terminal:

$ echo foo > dest/foo

Back to first terminal, log from the write. Kill it and remount.

2018-03-27 18:21:49,197 VER [DirNode.cpp:644] created FileNode for /home/val/source/
2018-03-27 18:21:49,197 VER [encfs.cpp:128] op: getattr : /home/val/source/
2018-03-27 18:21:50,117 VER [encfs.cpp:211] readdir on /home/val/source/
2018-03-27 18:21:50,117 VER [BlockNameIO.cpp:190] Rejecting filename .encfs6.xml
2018-03-27 18:21:50,118 VER [DirNode.cpp:104] error decoding filename: .encfs6.xml
2018-03-27 18:21:50,119 VER [DirNode.cpp:644] created FileNode for /home/val/source/
2018-03-27 18:21:50,119 VER [encfs.cpp:128] op: getattr : /home/val/source/
2018-03-27 18:21:50,119 VER [encfs.cpp:211] readdir on /home/val/source/
2018-03-27 18:21:50,119 VER [BlockNameIO.cpp:190] Rejecting filename .encfs6.xml
2018-03-27 18:21:50,119 VER [DirNode.cpp:104] error decoding filename: .encfs6.xml
2018-03-27 18:21:51,438 VER [DirNode.cpp:644] created FileNode for /home/val/source/
2018-03-27 18:21:51,438 VER [encfs.cpp:128] op: getattr : /home/val/source/
2018-03-27 18:21:51,438 VER [DirNode.cpp:644] created FileNode for /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,438 VER [encfs.cpp:128] op: getattr : /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,438 VER [DirNode.cpp:644] created FileNode for /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,438 VER [encfs.cpp:255] mknod on /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,, mode 33152, dev 0
2018-03-27 18:21:51,438 VER [DirNode.cpp:644] created FileNode for /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,438 VER [RawFileIO.cpp:116] open call, requestWrite = 1
2018-03-27 18:21:51,438 VER [RawFileIO.cpp:135] open file with flags 2, result = 4
2018-03-27 18:21:51,438 VER [encfs.cpp:534] encfs_open for /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,, flags 33345
2018-03-27 18:21:51,438 VER [encfs.cpp:128] op: fgetattr : /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,438 VER [encfs.cpp:128] op: flush : /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,438 VER [RawFileIO.cpp:116] open call, requestWrite = 0
2018-03-27 18:21:51,438 VER [RawFileIO.cpp:122] using existing file descriptor
2018-03-27 18:21:51,439 VER [encfs.cpp:96] op: getxattr : /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,439 VER [encfs.cpp:102] op: getxattr error: No data available
2018-03-27 18:21:51,439 VER [encfs.cpp:128] op: write : /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,439 VER [FileNode.cpp:213] FileNode::write offset 0, data size 4
2018-03-27 18:21:51,439 VER [CipherFileIO.cpp:195] creating new file IV header
2018-03-27 18:21:51,439 VER [CipherFileIO.cpp:222] initHeader finished, fileIV = 7129691133536335130
2018-03-27 18:21:51,439 VER [CipherFileIO.cpp:395] Called streamWrite
2018-03-27 18:21:51,439 VER [encfs.cpp:128] op: flush : /home/val/source/dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:21:51,439 VER [RawFileIO.cpp:116] open call, requestWrite = 0
2018-03-27 18:21:51,439 VER [RawFileIO.cpp:122] using existing file descriptor
^C
$ encfs ~/source ~/dest -f -v
2018-03-27 18:24:12,549 VER [main.cpp:548] Root directory: /home/val/source/
2018-03-27 18:24:12,549 VER [main.cpp:549] Fuse arguments: (fg) (threaded) (keyCheck) encfs /home/val/dest/ -f -o use_ino -o default_permissions 
2018-03-27 18:24:12,556 VER [FileUtils.cpp:294] found new serialization format
2018-03-27 18:24:12,557 VER [FileUtils.cpp:308] subVersion = 20100713
2018-03-27 18:24:12,560 VER [Interface.cpp:110] checking if ssl/aes(3:0:2) implements ssl/aes(3:0)
2018-03-27 18:24:12,560 VER [SSL_Cipher.cpp:333] allocated cipher ssl/aes, keySize 24, ivlength 16
2018-03-27 18:24:12,560 VER [FileUtils.cpp:1575] useStdin: 0
EncFS Password: 
2018-03-27 18:24:13,877 VER [Interface.cpp:110] checking if ssl/aes(3:0:2) implements ssl/aes(3:0)
2018-03-27 18:24:13,878 VER [SSL_Cipher.cpp:333] allocated cipher ssl/aes, keySize 24, ivlength 16
2018-03-27 18:24:14,418 VER [FileUtils.cpp:1583] cipher key size = 44
2018-03-27 18:24:14,418 VER [Interface.cpp:110] checking if nameio/block(4:0:2) implements nameio/block(4:0)

In second terminal:

$ ls dest/foo
ls: cannot access 'dest/foo': No such file or directory
$ ls -la dest/
total 8
drwxr-xr-x  2 val val 4096 Mar 27 18:21 .
drwxr-xr-x 35 val val 4096 Mar 27 18:26 ..

Read logs from encfs in first terminal:

2018-03-27 18:25:51,239 VER [DirNode.cpp:644] created FileNode for /home/val/source/
2018-03-27 18:25:51,239 VER [encfs.cpp:128] op: getattr : /home/val/source/
2018-03-27 18:25:51,239 VER [DirNode.cpp:644] created FileNode for /home/val/source/-82BjMeCiQ78mP35GSGSRK0d
2018-03-27 18:25:51,239 VER [encfs.cpp:128] op: getattr : /home/val/source/-82BjMeCiQ78mP35GSGSRK0d
2018-03-27 18:25:51,240 VER [DirNode.cpp:644] created FileNode for /home/val/source/-82BjMeCiQ78mP35GSGSRK0d
2018-03-27 18:25:51,240 VER [encfs.cpp:128] op: getattr : /home/val/source/-82BjMeCiQ78mP35GSGSRK0d
2018-03-27 18:26:15,970 VER [DirNode.cpp:644] created FileNode for /home/val/source/
2018-03-27 18:26:15,970 VER [encfs.cpp:128] op: getattr : /home/val/source/
2018-03-27 18:26:16,497 VER [encfs.cpp:96] op: getxattr : /home/val/source/
2018-03-27 18:26:16,497 VER [encfs.cpp:102] op: getxattr error: No data available
2018-03-27 18:26:16,497 VER [encfs.cpp:96] op: getxattr : /home/val/source/
2018-03-27 18:26:16,497 VER [encfs.cpp:102] op: getxattr error: No data available
2018-03-27 18:26:16,498 VER [encfs.cpp:211] readdir on /home/val/source/
2018-03-27 18:26:16,498 VER [BlockNameIO.cpp:238] checksum mismatch: expected 10702, got 33090 on decode of 3 bytes
2018-03-27 18:26:16,498 VER [DirNode.cpp:104] error decoding filename: dswZsJqwmzXSAlyaCGHXXlk,
2018-03-27 18:26:16,498 VER [BlockNameIO.cpp:190] Rejecting filename .encfs6.xml
2018-03-27 18:26:16,498 VER [DirNode.cpp:104] error decoding filename: .encfs6.xml
2018-03-27 18:26:16,498 VER [DirNode.cpp:644] created FileNode for /home/val/source/
2018-03-27 18:26:16,498 VER [encfs.cpp:128] op: getattr : /home/val/source/
2018-03-27 18:26:16,498 VER [encfs.cpp:96] op: getxattr : /home/val/source/
2018-03-27 18:26:16,498 VER [encfs.cpp:102] op: getxattr error: No data available
2018-03-27 18:26:16,499 VER [encfs.cpp:96] op: getxattr : /home/val/source/
2018-03-27 18:26:16,499 VER [encfs.cpp:102] op: getxattr error: No data available
ls -lA source/
total 8
-rw------- 1 val val   12 Mar 27 18:21 dswZsJqwmzXSAlyaCGHXXlk,
-rw-r--r-- 1 val val 1277 Mar 27 18:20 .encfs6.xml
 $ cat source/.encfs6.xml 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="7">
    <cfg class_id="0" tracking_level="0" version="20">
        <version>20100713</version>
        <creator>EncFS 1.9.1</creator>
        <cipherAlg class_id="1" tracking_level="0" version="0">
            <name>ssl/aes</name>
            <major>3</major>
            <minor>0</minor>
        </cipherAlg>
        <nameAlg>
            <name>nameio/block</name>
            <major>4</major>
            <minor>0</minor>
        </nameAlg>
        <keySize>192</keySize>
        <blockSize>1024</blockSize>
        <uniqueIV>true</uniqueIV>
        <chainedNameIV>true</chainedNameIV>
        <externalIVChaining>false</externalIVChaining>
        <blockMACBytes>0</blockMACBytes>
        <blockMACRandBytes>0</blockMACRandBytes>
        <allowHoles>true</allowHoles>
        <encodedKeySize>44</encodedKeySize>
        <encodedKeyData>
fwmfSKHLotBXL9UEFnGF8lBGSgoAgJFxfp5fgp/Ols7AQ0tiBX93GufJUDY=
</encodedKeyData>
        <saltLen>20</saltLen>
        <saltData>
5E+9y8Ny5I0hPEt4vW5L7owymps=
</saltData>
        <kdfIterations>377020</kdfIterations>
        <desiredKDFDuration>500</desiredKDFDuration>
    </cfg>
</boost_serialization>
@vleonbonnet
Copy link
Author

For completeness

$ cat source/dswZsJqwmzXSAlyaCGHXXlk, | base64 
2qlbaTfTijNcParM

@benrubson
Copy link
Contributor

Hi @vleonbonnet, you must hit this bug : #343, which has been corrected in 1.9.2.
Apply this workaround : #343 (comment)
And please update to 1.9.4 !

@benrubson
Copy link
Contributor

Closing this for now, feel free to re-open if needed.
Thx 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants