deciphering linux encfs (standard config, 192 bit aes) in Java

Has anyone tried to decipher files encrypted using linux encfs in Java? I'm interested in deciphering the file, and just the file name (not the whole file). I tried:

SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
//SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithMD5AndAES");
KeySpec spec = new PBEKeySpec("asdasd".toCharArray(), new String("Ip/6nf5p4Cvg4uocLdIeHJ7uW/Y=").getBytes(), 162752, 192);
SecretKey tmp = factory.generateSecret(spec);
SecretKey secret = new SecretKeySpec(tmp.getEncoded(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, secret);

I have encfs running with the dafault settings (standard mode, 192 bit aes), and the password should be "asdasd". The config file that encfs generates is:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  <!DOCTYPE boost_serialization>
  <boost_serialization signature="serialization::archive" version="7">
    <config class_id="0" tracking_level="1" version="20" object_id="_0">
<version>20100713</version>
<creator>EncFS 1.6</creator>
<cipherAlg class_id="1" tracking_level="0" version="0">
    <name>ssl/aes</name>
    <major>2</major>
    <minor>2</minor>
</cipherAlg>
<nameAlg>
    <name>nameio/block</name>
    <major>3</major>
    <minor>0</minor>
</nameAlg>
<keySize>192</keySize>
<blockSize>1024</blockSize>
<uniqueIV>1</uniqueIV>
<chainedNameIV>1</chainedNameIV>
<externalIVChaining>0</externalIVChaining>
<blockMACBytes>0</blockMACBytes>
<blockMACRandBytes>0</blockMACRandBytes>
<allowHoles>1</allowHoles>
<encodedKeySize>44</encodedKeySize>
<encodedKeyData>
    SFGMGDJNNROM/b+sMMlM24DxUsKW80Sen/IFaP849qqqPjy1jP1iiWB8eGB=
</encodedKeyData>
<saltLen>20</saltLen>
<saltData>
    qjGF2+ngKRPJ2zkx8dMw/Rv0nxg=
</saltData>
<kdfIterations>156293</kdfIterations>
<desiredKDFDuration>500</desiredKDFDuration>
    </config>
    </boost_serialization>

Has anyone tried this before and has the code to show for it?


This project seems to do exactly what you're talking about. It seems easy enough to use the API:

EncFSVolume encFSVolume = new EncFSVolume("<path>", "password");

Hope this helps!

链接地址: http://www.djcxy.com/p/8664.html

上一篇: 将键盘事件附加到HTML中的SVG元素

下一篇: 用Java解密linux encfs(标准配置,192位aes)