You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by neil hart <ne...@gmail.com> on 2008/09/24 19:35:11 UTC

Encrypting Excel files

I've looked through forums and such and it seems that POI can't use Excel's
built in encryption.  Has anyone build a process to get this to work.  I'm
thinking of sending the excel file to a windows box, running some VBscript
to encrypt the file, and then send it to the user.
The encryption that I'm looking for is the Excel's build in password
protection against reading the file.

Thanks in advance.

Re: Encrypting Excel files

Posted by Nick Burch <ni...@torchbox.com>.
On Fri, 26 Sep 2008, Dave Madole wrote:
> I was speaking of protected but unencrypted files, such as may be used 
> to protect the user from modifying the structure, but not make it 
> impossible to read the file--that is the situation I am trying to deal 
> with.

That ought to be supported by poi. There's certainly some code + unit 
tests in hssf usermodel for protecting and unprotecting workbooks and 
sheets. It might be worth you taking a look at the unit tests, and see 
what's different?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Encrypting Excel files

Posted by Dave Madole <dm...@iodalliance.com>.
Hi,

I was speaking of protected but unencrypted files, such as may be used to
protect the user from modifying the structure, but not make it impossible
to read the file--that is the situation I am trying to deal with. The
workbook and sheets are protected--ergo completely readable--but not
encrypted, so that the end user may change the content of the spreadsheet--
specifically edit empty rows--but not the structure.  I am under the
impression that all that was encrypted in that case were the passwords in
the "Protect" blocks.  I expected to be able to read those files (just as
I can in Excel without knowing the password) but so far I've been having
problems.

If this is a wrong impression, please let me know.

(I.e., it's like a "read-only" file, except that the users may modify
content of cells.)

Thanks,

D.


On 9/26/08 4:20 AM, "Nick Burch" <ni...@torchbox.com> wrote:

> On Thu, 25 Sep 2008, Dave Madole wrote:
>> That being said, should I be having problems ignoring the Records in the
>> File, Workbook and Sheet Protection Blocks with the current build, or
>> should they be serializing properly, or is this not open to discussion?
> 
> In an encrypted excel file, half the records are in the clear, and the
> other half are encrypted (so can only sensibly be read and written when
> you know the encryption scheme + key). So, I very much doubt poi will be
> able to get at all far with encrypted files as it stands
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Encrypting Excel files

Posted by Nick Burch <ni...@torchbox.com>.
On Thu, 25 Sep 2008, Dave Madole wrote:
> That being said, should I be having problems ignoring the Records in the 
> File, Workbook and Sheet Protection Blocks with the current build, or 
> should they be serializing properly, or is this not open to discussion?

In an encrypted excel file, half the records are in the clear, and the 
other half are encrypted (so can only sensibly be read and written when 
you know the encryption scheme + key). So, I very much doubt poi will be 
able to get at all far with encrypted files as it stands

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Encrypting Excel files

Posted by Dave Madole <dm...@iodalliance.com>.
That being said, should I be having problems ignoring the Records in the
File, Workbook and Sheet Protection Blocks with the current build, or
should they be serializing properly, or is this not open to discussion?

D.


On 9/25/08 2:18 AM, "Nick Burch" <ni...@torchbox.com> wrote:

> On Wed, 24 Sep 2008, neil hart wrote:
>> I've looked through forums and such and it seems that POI can't use
>> Excel's built in encryption.  Has anyone build a process to get this to
>> work.
> 
> Most of the encryption schemes supported by excel are not documented
> (and they're only provided by core windows functions), so even if we were
> to implement the encryption framework, we'd still only be able to read a
> very small number of the files (only those encrypted with standard
> algorithms)
> 
> Additionally, it'd be quite a lot of work to add support to poi for
> encryption, as all sorts of parts of the file changes, so no-one's been
> interested enough to sponsor the work
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Encrypting Excel files

Posted by Nick Burch <ni...@torchbox.com>.
On Wed, 24 Sep 2008, neil hart wrote:
> I've looked through forums and such and it seems that POI can't use 
> Excel's built in encryption.  Has anyone build a process to get this to 
> work.

Most of the encryption schemes supported by excel are not documented 
(and they're only provided by core windows functions), so even if we were 
to implement the encryption framework, we'd still only be able to read a 
very small number of the files (only those encrypted with standard 
algorithms)

Additionally, it'd be quite a lot of work to add support to poi for 
encryption, as all sorts of parts of the file changes, so no-one's been 
interested enough to sponsor the work

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Encrypting Excel files

Posted by Anthony Andrews <py...@yahoo.com>.
As far as I am aware, this is not possible. Thinking about it, I guess the reason is that the Excel application will do the encrytping and HSSF does not make use of Excel, rather it generates a file in a specific format.

--- On Wed, 9/24/08, neil hart <ne...@gmail.com> wrote:
From: neil hart <ne...@gmail.com>
Subject: Encrypting Excel files
To: user@poi.apache.org
Date: Wednesday, September 24, 2008, 10:35 AM

I've looked through forums and such and it seems that POI can't use
Excel's
built in encryption.  Has anyone build a process to get this to work.  I'm
thinking of sending the excel file to a windows box, running some VBscript
to encrypt the file, and then send it to the user.
The encryption that I'm looking for is the Excel's build in password
protection against reading the file.

Thanks in advance.



      

Collections

Posted by Awais Bajwa <ab...@macrosoftinc.com>.
I have to create an excel file of more then 40 thousand rows all having 10
columns. So I want to pass POI a collection of my records, and I have
already written a wrapper for this collection. Is there any built in
functionality available to achieve this? 

Regards
Awais Bajwa



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org