c# - How to enforce FIPS in asp.net code (This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.) -


my company has project created asp.net in .net framework 3.5 , windows web server 2008 r2 host project.

in web server, enabled setting "system cryptography: use fips compliant algorithms encryption, hashing, , signing"

after after application not run. shows following error

parser error message: implementation not part of windows platform fips validated cryptographic algorithms. 

stack trace:

[invalidoperationexception: implementation not part of windows platform fips validated cryptographic algorithms.]    system.security.cryptography.rijndaelmanaged..ctor() +7715396    system.web.configuration.machinekeysection.configureencryptionobject() +232    system.web.configuration.machinekeysection.ensureconfig() +156    system.web.configuration.machinekeysection.getencodeddata(byte[] buf, byte[] modifier, int32 start, int32& length) +37    system.web.ui.objectstateformatter.serialize(object stategraph) +166    system.web.ui.objectstateformatter.system.web.ui.istateformatter.serialize(object state) +4    system.web.ui.util.serializewithassert(istateformatter formatter, object stategraph) +37    system.web.ui.hiddenfieldpagestatepersister.save() +79    system.web.ui.page.savepagestatetopersistencemedium(object state) +105    system.web.ui.page.saveallstate() +236    system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +1099 

we looking solutions this. of solutions found online suggesting disable fips checking disabling setting "system cryptography: use fips compliant algorithms encryption, hashing, , signing". or adding these 2 lines in web.config.

<machinekey validationkey="autogenerate,isolateapps" decryptionkey="autogenerate,isolateapps" validation="3des" decryption="3des"/> <enforcefipspolicy enabled="false"/> 

but don't want disable fips checking our code security purpose. instead want adjust our code or server setting enforce fips policy in project interpreting functionalities.

can provide me idea on this?

there relevant msdn blog. try following registry changes:

  • hklm\system\currentcontrolset\control\lsa\fipsalgorithmpolicy\enabled registry value reflects current fips setting. if setting enabled, value 1. if setting disabled, value 0.
  • hklm\system\currentcontrolset\control\lsa\fipsalgorithmpolicy registry value reflects current fips setting. if setting enabled, value 1. if setting disabled, value 0.

after enable or disable system cryptography: use fips compliant algorithms encryption, hashing, , signing security setting, must restart application, such internet explorer, new setting take effect.

in case, should sufficient recycle website's app domain.

note comment @basic, enabling fips mode while potentially necessary interact government systems, can cause other security headaches.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -