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:mst...@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
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice