Using trunk of today (latest commit 2f8aa558b344f5e891e99cd020a0305d9a6e8e62), opening in Word 2010 a docx encrypted using POI gives the prompt: "This file may have been tampered with or corrupted and the contents should not be trusted. Do you wish to continue opening this file?" This is the first time I've tried doing this, so I'm not sure whether this is a regression or not. Code to repro: POIFSFileSystem fs = new POIFSFileSystem(); EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile); Encryptor enc = info.getEncryptor(); enc.confirmPassword("foobaa"); OPCPackage opc = OPCPackage.open(new File(inputfilepath), PackageAccess.READ_WRITE); OutputStream os = enc.getDataStream(fs); opc.save(os); opc.close(); FileOutputStream fos = new FileOutputStream(new File(outputfilepath)); fs.writeFilesystem(fos); fos.close(); Input a simple hello world docx (I created one in Word 2010).
I guess this error was introduced by r1647867 I'm onto it ...
fixed with r1690837 Actually this was only a test, if anyone uses the encryption code (facepalm) This bug was introduced right after 3.11 final came out and affected the checksum calculation. Please confirm it, as I currently have only Libre Office, Excel Viewer (can't process agile encryption, only standard encryption) and Word Viewer available...
Fix confirmed. Thank you!