You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by SRUJITH PULIPAKA <sr...@gmail.com> on 2025/04/08 07:24:05 UTC

Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Hi Apache PDFBox Team,

I hope you're doing well.

We are currently using Apache PDFBox in our software stack and have
encountered an issue when deploying it in environments that enforce *FIPS
140-3 compliance.*

Specifically, in the *COSWriter class*, PDFBox uses the
*MessageDigest.getInstance("MD5")* call to generate document IDs. Under a
FIPS-enabled JVM, MD5 is not allowed as it is not a FIPS-approved
algorithm, leading to a `NoSuchAlgorithmException` during PDF generation.

Is there any workaround or configuration to avoid MD5 in such environments?
Alternatively, would the PDFBox team consider supporting a configurable or
FIPS-compatible digest algorithm (like SHA-256) for the document ID
generation?

We’d greatly appreciate any guidance or future roadmap considerations in
this regard. Thanks again for maintaining this excellent open-source
library.

Best regards,
Srujith

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tres Finocchiaro <tr...@gmail.com>.
+SRUJITH PULIPAKA <sr...@gmail.com>

Please see quoted text below which has a link to the snapshot build with
this fix.

(and please fix your emails settings so that these emails come through :D)

On Thu, Apr 24, 2025 at 1:33 PM Tilman Hausherr <TH...@t-online.de>
wrote:

> The fix to SHA-256 was Andreas. It turned out that SHA256 didn't work on
> linux. You can get a snapshot build here
>
> https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.5-SNAPSHOT/
> or wait a week or two until the next version will be released.
> Tilman
>

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tilman Hausherr <TH...@t-online.de>.
The fix to SHA-256 was Andreas. It turned out that SHA256 didn't work on 
linux. You can get a snapshot build here
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.5-SNAPSHOT/
or wait a week or two until the next version will be released.
Tilman

On 24.04.2025 18:54, Tres Finocchiaro wrote:
> Srujith,
>
> Hi, I did not author this patch, I only placed you on copy since your
> email settings appeared to prevent you from receiving replies from the
> mailing list.
>
> Here's Tilman's patch:
> https://github.com/apache/pdfbox/commit/3fe8ed6c82d80e6cdd133221729b270d3f87cc99
>
> Here's Tilman fixing "SHA256" to "SHA-256"
> https://github.com/apache/pdfbox/commit/9e49f3910f4dd485764c3c0ec5658c150ebb5f62
>
> With regards to a workaround, I would recommend building PDFBOX 3.0 trunk
> from source which should have this feature enabled.
>
> -Tres.Finocchiaro@gmail.com
>
>
> On Thu, Apr 24, 2025 at 12:09 PM SRUJITH PULIPAKA<sr...@gmail.com>
> wrote:
>
>> Hi Tres,
>> As you are saying that SHA-256 doesn’t work in every environment, do I get
>> any workaround for this?
>> Please let me know your suggestions for FIPS enabled
>> Appreciate your help in advance.
>>
>> Thanks,
>> Srujith
>>
>> On Fri, 11 Apr 2025 at 7:53 PM, Tres Finocchiaro <
>> tres.finocchiaro@gmail.com> wrote:
>>
>>> Srujith,
>>>
>>> Placing you explicitly on copy in case your email settings are filtering
>>> replies here...
>>>
>>> Tillman replied with this response:
>>>
>>> Done
>>>> https://issues.apache.org/jira/browse/PDFBOX-5985
>>>
>>> -Tres.Finocchiaro@gmail.com
>>>

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tres Finocchiaro <tr...@gmail.com>.
Srujith,

Hi, I did not author this patch, I only placed you on copy since your
email settings appeared to prevent you from receiving replies from the
mailing list.

Here's Tilman's patch:
https://github.com/apache/pdfbox/commit/3fe8ed6c82d80e6cdd133221729b270d3f87cc99

Here's Tilman fixing "SHA256" to "SHA-256"
https://github.com/apache/pdfbox/commit/9e49f3910f4dd485764c3c0ec5658c150ebb5f62

With regards to a workaround, I would recommend building PDFBOX 3.0 trunk
from source which should have this feature enabled.

- Tres.Finocchiaro@gmail.com


On Thu, Apr 24, 2025 at 12:09 PM SRUJITH PULIPAKA <sr...@gmail.com>
wrote:

> Hi Tres,
> As you are saying that SHA-256 doesn’t work in every environment, do I get
> any workaround for this?
> Please let me know your suggestions for FIPS enabled
> Appreciate your help in advance.
>
> Thanks,
> Srujith
>
> On Fri, 11 Apr 2025 at 7:53 PM, Tres Finocchiaro <
> tres.finocchiaro@gmail.com> wrote:
>
>> Srujith,
>>
>> Placing you explicitly on copy in case your email settings are filtering
>> replies here...
>>
>> Tillman replied with this response:
>>
>> Done
>>> https://issues.apache.org/jira/browse/PDFBOX-5985
>>
>>
>> - Tres.Finocchiaro@gmail.com
>>
>

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tres Finocchiaro <tr...@gmail.com>.
Srujith,

Placing you explicitly on copy in case your email settings are filtering
replies here...

Tillman replied with this response:

Done
> https://issues.apache.org/jira/browse/PDFBOX-5985


- Tres.Finocchiaro@gmail.com

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tres Finocchiaro <tr...@gmail.com>.
Srujith,

Placing you explicitly on copy in case your email settings are filtering
replies here...

Tillman replied with this response:

Done
> https://issues.apache.org/jira/browse/PDFBOX-5985


- Tres.Finocchiaro@gmail.com

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by SRUJITH PULIPAKA <sr...@gmail.com>.
This is a follow-up mail.
Can someone please help with this issue?

Thanks,
Srujith

On Tue, Apr 8, 2025 at 12:54 PM SRUJITH PULIPAKA <sr...@gmail.com>
wrote:

> Hi Apache PDFBox Team,
>
> I hope you're doing well.
>
> We are currently using Apache PDFBox in our software stack and have
> encountered an issue when deploying it in environments that enforce *FIPS
> 140-3 compliance.*
>
> Specifically, in the *COSWriter class*, PDFBox uses the
> *MessageDigest.getInstance("MD5")* call to generate document IDs. Under a
> FIPS-enabled JVM, MD5 is not allowed as it is not a FIPS-approved
> algorithm, leading to a `NoSuchAlgorithmException` during PDF generation.
>
> Is there any workaround or configuration to avoid MD5 in such
> environments? Alternatively, would the PDFBox team consider supporting a
> configurable or FIPS-compatible digest algorithm (like SHA-256) for the
> document ID generation?
>
> We’d greatly appreciate any guidance or future roadmap considerations in
> this regard. Thanks again for maintaining this excellent open-source
> library.
>
> Best regards,
> Srujith
>

Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tilman Hausherr <TH...@t-online.de>.
Done
https://issues.apache.org/jira/browse/PDFBOX-5985

Tilman

On 08.04.2025 11:28, Tilman Hausherr wrote:
> Lets wait if there are other reactions, I'd prefer to just change it 
> to SHA256. Files will be 64 bytes longer, no need to expand the API.
>
> Be aware that md5 is also used elsewhere, e.g. when encrypting or 
> decrypting PDFs, it's part of the algorithm.
>
> Tilman
>
> On 08.04.2025 09:24, SRUJITH PULIPAKA wrote:
>> Hi Apache PDFBox Team,
>>
>> I hope you're doing well.
>>
>> We are currently using Apache PDFBox in our software stack and have
>> encountered an issue when deploying it in environments that enforce 
>> *FIPS
>> 140-3 compliance.*
>>
>> Specifically, in the *COSWriter class*, PDFBox uses the
>> *MessageDigest.getInstance("MD5")* call to generate document IDs. 
>> Under a
>> FIPS-enabled JVM, MD5 is not allowed as it is not a FIPS-approved
>> algorithm, leading to a `NoSuchAlgorithmException` during PDF 
>> generation.
>>
>> Is there any workaround or configuration to avoid MD5 in such 
>> environments?
>> Alternatively, would the PDFBox team consider supporting a 
>> configurable or
>> FIPS-compatible digest algorithm (like SHA-256) for the document ID
>> generation?
>>
>> We’d greatly appreciate any guidance or future roadmap considerations in
>> this regard. Thanks again for maintaining this excellent open-source
>> library.
>>
>> Best regards,
>> Srujith
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Inquiry: PDFBox FIPS Compliance – MD5 Usage in COSWriter Class

Posted by Tilman Hausherr <TH...@t-online.de>.
Lets wait if there are other reactions, I'd prefer to just change it to 
SHA256. Files will be 64 bytes longer, no need to expand the API.

Be aware that md5 is also used elsewhere, e.g. when encrypting or 
decrypting PDFs, it's part of the algorithm.

Tilman

On 08.04.2025 09:24, SRUJITH PULIPAKA wrote:
> Hi Apache PDFBox Team,
>
> I hope you're doing well.
>
> We are currently using Apache PDFBox in our software stack and have
> encountered an issue when deploying it in environments that enforce *FIPS
> 140-3 compliance.*
>
> Specifically, in the *COSWriter class*, PDFBox uses the
> *MessageDigest.getInstance("MD5")* call to generate document IDs. Under a
> FIPS-enabled JVM, MD5 is not allowed as it is not a FIPS-approved
> algorithm, leading to a `NoSuchAlgorithmException` during PDF generation.
>
> Is there any workaround or configuration to avoid MD5 in such environments?
> Alternatively, would the PDFBox team consider supporting a configurable or
> FIPS-compatible digest algorithm (like SHA-256) for the document ID
> generation?
>
> We’d greatly appreciate any guidance or future roadmap considerations in
> this regard. Thanks again for maintaining this excellent open-source
> library.
>
> Best regards,
> Srujith
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org