Hi Michael,
Thanks a lot for your hint!
But I still got some problems. With your suggestion, I used these two jars which looks like the new
version.
-odfdom-java-0.8.10-incubation-SNAPSHOT-jar-with-dependencies.jar
-simple-odf-0.8.1-incubation-SNAPSHOT-jar-with-dependencies.jar
ENV: Libreoffice 4.1.4.2 & Libreoffice 3.x / java 1.7
1. Open a .ods file manually, save it with password.
2. In code, execute “SpreadsheetDocument.loadDocument(File file, String password)”, it always
throw NullPointer Exception.
->After checking the source code, the code in ZipHelper.line87:
System.getProperty(“Java.version”).equals(…) in try/catch will throw NullPointer.
->Obviously the parameter here should use “java.version” instead, but the code in line83:
inputStream.getNextEntry() always throw java.util.zip.ZipException: only DEFLATED entries can have
EXT descriptor, which is the key reason.
Then I tried API to load a unencrypted .ods file and save it with password with code
org.odftoolkit.simple.Document.save(File file, String pasword). In this case, I can load the
encrypted file with code.
Based on this situation, I don’t know if you tried with this API before. And do you have some more
information?
Thanks again!
Best Regards
William
-----Original Message-----
From: Michael Stahl [mailto:mstahl@redhat.com]
Sent: 2016年1月5日 0:39
To: Zhang, William; libreoffice@lists.freedesktop.org
Subject: Re: How to decrypt ods file
On 25.12.2015 06:08, Zhang, William wrote:
Does anyone know how to decrypt an encrypted Libreoffice Calc file
with Java or other languages? Or even some workarounds. Thanks a lot!
the Apache ODF Toolkit ODFDOM library supports ODF encryption, at least with the "old"
Blowfish/SHA1 algorithms that were used in LO <= 3.5 (i'm not aware if anybody has added support
for AES, which is used since LO 3.5).
http://incubator.apache.org/odftoolkit/odfdom/index.html
see the "password" parameter on the constructor of class org.odftoolkit.odfdom.pkg.OdfPackage
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.