Latest version of AsposePDF produces FIPS compliance error while saving acroform

I upgraded asposePDF nuget from 24.7 to 25.4, and while everything works on my development environment, calling Document.Save() gives me the following error on my Stage environment, which is a more restrictive and secure instances managed by our webhost.

Error message:
This implementation is not part of the windows platform FIPS validated cryptogarphic algorithm.

The PDF document I am saving is acroform. I’d be happy to provide sample code, but i think this is a server configuration issue. Any idea how I can by pass?

thank you!

I did some more troubleshooting. On my dev environment, I turn on FIPS Compliance and was able to reproduce the same error:

Go to Administrative Tools > Local Security Policy > Local Policies > Security Options > System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing
Switch the flag to Enabled.

And then I went up the version from 24.7. I run into this error going from 24.10 to 24.11. So, something change in version 24.11 cause some crypto function to become non FIPS compliant…

please give guidance how to bypass this.

@hao.deng

Can you please share the sample code snippet with us along with the complete information of the server where this is running? We will log an investigation ticket to analyze details and share the ID with you.

Sample code, my project is a asp.net webform

        var pdfPath = Path.Combine(Request.PhysicalApplicationPath, "blank.pdf");
        var pdfBase = File.ReadAllBytes(pdfPath);
        using (var doc = new Document(new MemoryStream(pdfBase)))
        {
            
            var tf = new TextFragment("test text");
            tf.Position = new Position(200, 330);
            var page = doc.Pages[1];
            page.Paragraphs.Add(tf);
            
            using (var rv = new MemoryStream())
            {
                doc.Save(rv);
                Response.Clear();
                Response.AddHeader("content-disposition", "attachment; filename=out.pdf ");
                Response.BinaryWrite(rv.ToArray());
                Response.ContentType = "application/octet-stream";
                Response.End();
            }
        }

Windows environment:
OS: Windows Server 2022 Datacenter
Setting: Administrative Tools > Local Security Policy > Local Policies > Security Options > System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing: ENABLE

Error Stack trace

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args)
at System.Security.Cryptography.MD5.Create()
at #=zAFZhrBStm7AHCz0VQEX7O8UzyTrsAY4gjPiw66nuiJzidmEpqHwjJsI=.#=zSHrNFbY=(#=zoB62HX8H67v14$LQSJn3uNOFN1vqurjLLjlfOyA= #=zKk_K9rE=)
at #=z6HQ73iZOcVn4IPseLrDIRY9VrVtdAq0UXHOfkGv3GC_MbwLXhIAFP1g=.#=zoqRre7VtzC_GbmWIbg==(#=zoB62HX8H67v14$LQSJn3uNOFN1vqurjLLjlfOyA= #=zKk_K9rE=, List`1 #=ziCcL0ixRWu$d, Int32 #=zd9gM0Nq7$BHipG_K9g==)
at #=z6HQ73iZOcVn4IPseLrDIRY9VrVtdAq0UXHOfkGv3GC_MbwLXhIAFP1g=.#=zQjIdKJk=(#=zueUk47_OjtFeFFUxO$w1RMXAo47q2GW9U3k8hLTSR$Oo #=zKcdhHfLD5Hdw, #=zoB62HX8H67v14$LQSJn3uNOFN1vqurjLLjlfOyA= #=zKk_K9rE=, SaveOptions #=z5wBUYWT4kpcB)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zoHteZx3MuBAH661QFmXUmduxifLC(Object #=z$D29mko=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zgTqsErzZQbTPeomzy24aqrw=(MethodBase #=z$D29mko=, Boolean #=zcKf3zwE=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zVnUNkOkcKer0WON0xw8DFRrQgoy5(dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd #=z$D29mko=, #=qSXkKALjjizp9UvDPhnfE_GVATyQDDXrrKGtVcwDv3Ss= #=zcKf3zwE=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zb4Ol60yEj6rgmzr8jnxvoDEqTIeH()
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=z$msM_2IVqse$_LRaUljW3cxdhlW8(Boolean #=z$D29mko=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zoHteZx3MuBAH661QFmXUmduxifLC(Object #=z$D29mko=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zi2XeJjfvMUe5c_FeBZwgW8C9XPJQ()
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zUpkBwFH0zv2pN3wyKiAarz1U6RVnpoC2bRK807E=(Object #=z$D29mko=, UInt32 #=zcKf3zwE=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=z$msM_2IVqse$_LRaUljW3cxdhlW8(Boolean #=z$D29mko=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zkUZVh9$AmyDTHwM2iT7cOoBTCuMlxNRWRdw8I8T7g$YH()
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zKmOL_TUZ50Q6CRK00yopKEbJNsI$znz6P84Cz3cIX9SG(Object[] #=z$D29mko=, Type[] #=zcKf3zwE=, Type[] #=zgeIXF2g=, Object[] #=zpfa5Jak=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zBPwEJbDZtm5t3u5pb7RqxpMYLNoTTFxOsL1f31c=(Stream #=z$D29mko=, String #=zcKf3zwE=, Object[] #=zgeIXF2g=, Type[] #=zpfa5Jak=, Type[] #=zvzodRNs=, Object[] #=zebKcfGo=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=ziYPWOjKlC3nplqgQENEnhKo=(Stream #=z$D29mko=, String #=zcKf3zwE=, Object[] #=zgeIXF2g=)
at dje_qJHLKVF4YC2CRVNZ4CDB787H74KUEFJ6TVMRL969PC9RW4526AJ8Q_ejd.#=zfH28mbdSFf6f5z4YpOz4TG669DwQ(Stream #=z$D29mko=, String #=zcKf3zwE=, Object[] #=zgeIXF2g=)
at #=zdoRdcBLQ5Kf5FknnEt9mjd52yDChovlFMQ==.#=zQjIdKJk=(SaveOptions #=z5wBUYWT4kpcB)
at #=zhvfdLhrlyKCGbXHDBMeIXN7hkWKj9w43uw==.#=zQjIdKJk=(Stream #=zgnqD41Y=, SaveOptions #=z5wBUYWT4kpcB)
at #=zpTXy1z8btg2vAC_xg1rzQErgv0Vk.#=zQjIdKJk=(Stream #=zgnqD41Y=, SaveOptions #=z5wBUYWT4kpcB)
at Aspose.Pdf.Document.#=zRoSm$ePjZVmZ(Stream #=zumREUgY=, SaveOptions #=z5wBUYWT4kpcB)
at Aspose.Pdf.Document.Save(Stream output)

blank.pdf (25.0 KB)

@hao.deng

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-59759

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.