The answer depends heavily on the configuration that you are trying to
implement. If you are aiming at reproducing 'paranoid' config, then
you need to consider both ivs in file block, as well iv chaining
taking place in filenames.

Filename encryption with external iv chaining works on whole paths.
The algorithm works its way decrypting path components starting from
top-most directory down to your file. In the process the iv is updated
using hmac algoritm and previous iv value (thus "chaining".) Initial
iv value for top-most directory is 0; you may want to look into
NameIO.cpp decodePath/encodePath for starting point of the process.

If you are using encryption scheme with iv header, then the final
'filename iv" value is used for encrypting/decrypting file iv stored
in the header. This file iv (xored with current block number) is used
to encrypt/decrypt file contents. If you are not using iv-headers,
then your iv for each block is just its number. The same applies to
last block in file.

Cheers,
Andrzej

2012/7/31 David Vasseur <dvass...@diway.net>:
> Hi,
>
> I'm trying to implement some of the encfs features in a python program
> (off-site backup to a webdav server) and I don't really understand how
> "IV chaining" is working.
>
> As I understand, it's the function 'setIVec' in SSL_Cipher.cpp which is
> used to calculate an IV based on a "seed" (previous IV ?) but:
> - how can I initialize it ? Where is this "initial seed" ? How is it used ?
> - Is this "IV chaining" also used for end-of-file streaem cipher (AES
> CFB) ? I think so but how is the IV calculated in this case ?
>
> Thanks !
> David
>
> PS. I know I could use davfs but it's not working that well here (cache,
> not designed for huge files uplaod, ...)
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Encfs-users mailing list
> Encfs-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/encfs-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Encfs-users mailing list
Encfs-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/encfs-users

Reply via email to