Skip to content

Unable to decode files (WARNING MAC comparison failure in block 0) #559

Closed

Description

@bpavacic

Hi,

I am running encfs version 1.9.5 on an Ubuntu box.
Many files I have encrypted have suddenly become unreadable - I am getting a "MAC comparison failure in block 0" error:

$ encfsctl cat . pYyW,TEr7GgZkMuXon7E6Qew/DOYIHjSVGwUpq4zMvuTvclp4/v1xg9YU5loccxZZzs8kV,4,G/GxtilKL6Zfsg0AtPBSMKmzBQ 
EncFS Password: 
2019-10-01 17:36:55,859 WARNING MAC comparison failure in block 0

I highly doubt the files themselves are corrupted. Mounting the encrypted folder with --forcedecode results in corrupted files.
Renaming the folders COULD be the reason as I have moved some folders around.
Is there anything I can do to get the files back? Please help

$ cat .encfs6.xml 
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="12">
<cfg class_id="0" tracking_level="0" version="20">
	<version>20100713</version>
	<creator>EncFS 1.8.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>256</keySize>
	<blockSize>1024</blockSize>
	<uniqueIV>1</uniqueIV>
	<chainedNameIV>1</chainedNameIV>
	<externalIVChaining>1</externalIVChaining>
	<blockMACBytes>8</blockMACBytes>
	<blockMACRandBytes>0</blockMACRandBytes>
	<allowHoles>1</allowHoles>
	<encodedKeySize>52</encodedKeySize>
	<encodedKeyData>
iN1itJoreRyIzmRCil/XjHkAjOjtZUeyn0IVs3nQDAfSIdws4uNbDPLqmZV+3KiritEiCQ==
	</encodedKeyData>
	<saltLen>20</saltLen>
	<saltData>
id01YOu5QAUdXOZh7ma9oK9TTTE=
	</saltData>
	<kdfIterations>1503741</kdfIterations>
	<desiredKDFDuration>3000</desiredKDFDuration>
</cfg>
</boost_serialization>

Activity

  1. rfjakob commented on Oct 12, 2019

    @rfjakob
    Collaborator

    Did you have a crash / network drive disconnect / some other problems during moving the folders?

  2. bpavacic commented on Oct 14, 2019

    @bpavacic
    Author

    Hi,
    it turned out to be related to "filename to IV header chaining" #141 (externalIVChaining=1). I recently had to recover the (encrypted) contents from Google Drive using Insync on Ubuntu and Insync failed to pick up and re-upload files that I have moved around.

    I have managed to recover some of the files by moving encrypted versions back to their original folders if I could recall where it was. I have pulled some files from a backup hard drive literally on another continent. Lots of scripting and manual work was involved.

    Can you please confirm that the following configuration will have atomic moves (underlying FS move only with no re-encryption or modifications to encrypted files)?

    <?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.5</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>
            <plainData>0</plainData>
            <uniqueIV>1</uniqueIV>
            <chainedNameIV>1</chainedNameIV>
            <externalIVChaining>0</externalIVChaining>
            <blockMACBytes>0</blockMACBytes>
            <blockMACRandBytes>0</blockMACRandBytes>
            <allowHoles>1</allowHoles>
            <encodedKeySize>44</encodedKeySize>
            <encodedKeyData>
    zFbACkpuua9MZskQ3GDSeu1FABmsRyUQivpV6fDvgNAf8W6FwCk8Rfkbdus=
    </encodedKeyData>
            <saltLen>20</saltLen>
            <saltData>
    BsqlwEXlr9qwTfq7ZT8+XmgG2Fg=
    </saltData>
            <kdfIterations>398411</kdfIterations>
            <desiredKDFDuration>500</desiredKDFDuration>
        </cfg>
    </boost_serialization>
    
    
  3. benrubson commented on Oct 26, 2019

    @benrubson
    Contributor

    No modification to files' content, but filenames may change, see man note on Filename Initialization Vector Chaining which is activated in your configuration.

  4. bpavacic commented on Oct 30, 2019

    @bpavacic
    Author

    Closing the issue as encfs is working as intended. It is just something worth keeping in mind when using tools synchronizing encrypted files to the cloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions