RE: Encryption/password protected excel/word files

2007-04-17 Thread Justin Warren
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.

thanks

-Original Message-
From: Justin Warren 
Sent: Monday, April 16, 2007 2:49 PM
To: poi-user@jakarta.apache.org
Subject: Encryption/password protected excel/word files

Hi all, 

 

I am trying to detect if a file is password protected before reading it
(ie, if it is password protected, I want to ignore it). Right now, I am
just catching exceptions that get thrown, but I was wondering if there
was another way of doing this.

 

Thanks



-
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: Encryption/password protected excel/word files

2007-04-17 Thread Andrew C. Oliver
Guys lets stay away from encryption.  We'd have to do all this 
registering with the government and a whole lot of hassle for not much 
benefit.  Lame encryption to boot.


Nick Burch wrote:

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.


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


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



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


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/



--

From Windows/Exchange to Linux/Meldware

Buni Meldware Communication Suite
Email, Calendaring, ease of configuration/administration
http://buni.org


-
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: Encryption/password protected excel/word files

2007-04-17 Thread Rainer Klute
Andrew C. Oliver schrieb:
 Guys lets stay away from encryption.  We'd have to do all this
 registering with the government and a whole lot of hassle for not much
 benefit.  Lame encryption to boot.

This depends. We here in Europe or at least here in Germany don't have
to do any registering with the government for encryption/decryption.

Best regards
Rainer Klute

   Rainer Klute IT-Consulting
  Dipl.-Inform.
  Rainer Klute E-Mail:  [EMAIL PROTECTED]
  Körner Grund 24  Telefon: +49 172 2324824
D-44143 Dortmund   Telefax: +49 231 5349423

OpenPGP fingerprint: E4E4386515EE0BED5C162FBB5343461584B5A42E




signature.asc
Description: OpenPGP digital signature


Re: Encryption/password protected excel/word files

2007-04-17 Thread David Fisher
Since the apache servers are in the United States, and the Apache  
Foundation is a US not for profit corporation, all projects are  
required to meet US Export regulations with regard to encryption  
technology.


See http://www.apache.org/licenses/exports/

Regards,
Dave

On Apr 17, 2007, at 12:10 PM, Rainer Klute wrote:


Andrew C. Oliver schrieb:

Guys lets stay away from encryption.  We'd have to do all this
registering with the government and a whole lot of hassle for not  
much

benefit.  Lame encryption to boot.


This depends. We here in Europe or at least here in Germany don't have
to do any registering with the government for encryption/decryption.

Best regards
Rainer Klute

   Rainer Klute IT-Consulting
  Dipl.-Inform.
  Rainer Klute E-Mail:  [EMAIL PROTECTED]
  Körner Grund 24  Telefon: +49 172 2324824
D-44143 Dortmund   Telefax: +49 231 5349423

OpenPGP fingerprint: E4E4386515EE0BED5C162FBB5343461584B5A42E





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