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

有没有人试图破译在Java中使用linux encfs加密的文件? 我对解密文件感兴趣,只是文件名(不是整个文件)。 我试过了:

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);

我使用默认设置(标准模式,192位aes)运行encfs,密码应为“asdasd”。 encfs生成的配置文件是:

<?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>

有没有人尝试过,并有代码显示它?


这个项目似乎正在做你正在谈论的内容。 使用API​​似乎很容易:

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

希望这可以帮助!

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

上一篇: deciphering linux encfs (standard config, 192 bit aes) in Java

下一篇: How to get displayed width of a string?