Re[2]: Encryption/password protected excel/word files

2007-04-17 Thread Yegor Kozlov
I wonder if Microsoft uses encryption compatible with
javax.crypto.*. If yes, we have a chance to decode it. Otherwise it is
not worth the trouble.

Yegor

NB On Tue, 17 Apr 2007, Justin Warren wrote:
 I should mention that the exceptions don't really tell if the files are 
 password protected or not. For word, I catch an 
 ArrayIndexOutOfBoundsException, or java.lang.NegativeArraySizeException. 
 I'm guessing that is not the expected behaviour.

NB With powerpoint, we did find one record we could look for early on that 
NB indicates if the file is encrypted or not. For the others, we haven't 
NB spotted anything suitable.

NB The problem is that if the file is encrypted, lots of the core records are 
NB there, but there data is encrytped, and hence garbage if you try to read 
NB it as if it wasn't. Unless we can tell very early on that a file is 
NB encrypted, we can't just look through the record list looking for the 
NB encrypted record flag, since the parent records can't be read properly. 
NB Instead, we must find either a absolute offset to an indicator, or one 
NB non encrypted record at a given location that'll have a child that tells 
NB you it's encrypted.


NB If someone encrypts both the properties and the document, it's easy, as 
NB you can tell at the poifs level. If they just encrypt the document, it's 
NB hard. See EncryptedSlideShow in hslf for an example of how to do it for 
NB powerpoint. Any suggestions for a similar way to do it for word or excel 
NB gratefully received :)

NB Nick

NB -
NB To unsubscribe, e-mail: [EMAIL PROTECTED]
NB Mailing List: http://jakarta.apache.org/site/mail2.html#poi
NB The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



Re[2]: Encryption/password protected excel/word files

2007-04-17 Thread Nick Burch

On Tue, 17 Apr 2007, Yegor Kozlov wrote:
I wonder if Microsoft uses encryption compatible with javax.crypto.*. If 
yes, we have a chance to decode it. Otherwise it is not worth the 
trouble.


I don't think they do. For PPT, there's a choice of about 10 different 
encryption options, almost all of which have very similar names, and most 
of them have Microsoft somewhere in their name...


I think that supporting encrypting / decrypting the files is not going to 
be possible. However, we might be able to detect encrypted files (as we do 
for ppt), but it'll take some work.


Nick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/