2011-07-19 54 views
7

有沒有人試圖破解在Java中使用linux encfs加密的文件?我對解密文件感興趣,只是文件名(不是整個文件)。我想:在Java中解密linux encfs(標準配置,192位aes)

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

我與dafault設置運行encfs(標準模式,192位AES),密碼應該是 「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> 

有任何人試圖在此之前,有代碼來顯示它?

回答

3

This project似乎正是你所說的。使用API​​似乎很容易:

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

希望這有助於!