简体   繁体   English

连接 WCF Cryptography.CryptographicException:指定的初始化向量 (IV) 与此算法的块大小不匹配

[英]Connect WCF Cryptography.CryptographicException: Specified initialization vector (IV) does not match the block size for this algorithm

In my project I got frequent error relate to "Cryptography" from my log file.在我的项目中,我的日志文件中经常出现与“密码学”相关的错误。 Detail:细节:

Global.aspx:  - System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Security.Cryptography.CryptographicException: Specified initialization vector (IV) does not match the block size for this algorithm.
   at System.Security.Cryptography.RijndaelManagedTransform..ctor(Byte[] rgbKey, CipherMode mode, Byte[] rgbIV, Int32 blockSize, Int32 feedbackSize, PaddingMode PaddingValue, RijndaelManagedTransformMode transformMode)
   at System.Security.Cryptography.RijndaelManaged.NewEncryptor(Byte[] rgbKey, CipherMode mode, Byte[] rgbIV, Int32 feedbackSize, RijndaelManagedTransformMode encryptMode)

But actualy, In my project I can't find anything code statement relate to that.但实际上,在我的项目中,我找不到任何与此相关的代码语句。 Except some statement were auto generated by visual studio when I connect my project with WCF service除了当我将我的项目与 WCF 服务连接时,Visual Studio 会自动生成一些语句

Detail in: ./MyProject/Connected Services/WCFServiceName/configuaration91.svcinfo详细信息:./MyProject/Connected Services/WCFServiceName/configuaration91.svcinfo

        <property path="/identity/certificateReference/storeName" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreName, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <serializedValue>My</serializedValue>
        </property>
        <property path="/identity/certificateReference/storeLocation" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreLocation, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <serializedValue>LocalMachine</serializedValue>
        </property>
        <property path="/identity/certificateReference/x509FindType" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.X509FindType, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <serializedValue>FindBySubjectDistinguishedName</serializedValue>
        </property>

I have try to solve and find the solution for that problem, but I don't find any question similar question.我试图解决并找到该问题的解决方案,但我没有找到任何类似问题的问题。

I don't know who to turn to the advice for this subject.我不知道该向谁寻求有关此主题的建议。 Pls help me请帮助我

Thank you!谢谢!

The error about the initialization vector (IV) and the presence of RijndaelManaged class implies that your WCF service is using a form of AES encryption.关于initialization vector (IV)的错误和RijndaelManaged 的存在意味着您的 WCF 服务正在使用一种 AES 加密形式。

Have you checked whether the WCF service is not under one of these un-supported scenarios ?您是否检查过 WCF 服务是否不在这些不受支持的场景之一下? https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/unsupported-scenarios https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/unsupported-scenarios

FIPS-compliant AES encryption does not work in duplex callbacks under identification level impersonation.符合 FIPS 的 AES 加密在身份级别模拟下的双工回调中不起作用。

First, you need to confirm whether the relevant code is included.首先需要确认是否包含相关代码。 If it contains,you can refer to Specified initialization vector (IV) does not match the block size for this algorithm , if you change the user account that runs the IIS workflow, System.Security.Cryptography.CryptographicException may occur.如果包含,您可以参考指定的初始化向量(IV)与此算法的块大小不匹配,如果您更改运行 IIS 工作流的用户帐户,则可能会出现 System.Security.Cryptography.CryptographicException。 If this is the case, you must give read access privileges to the process's account for the file containing the private key.如果是这种情况,您必须授予进程帐户对包含私钥的文件的读取访问权限。 For example, if the IIS worker process is running under the Bob account, then you will need to give Bob read access to the file containing the private key.例如,如果 IIS 工作进程在 Bob 帐户下运行,则您需要授予 Bob 对包含私钥的文件的读取权限。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 指定的初始化向量(IV)与该算法的块大小不匹配 - The specified initialization vector (IV) does not match the block size for this algorithm 指定的初始化向量(IV)与此算法的块大小不匹配 - Specified initialization vector(IV) does not match the block size for this algorithm 指定的初始化向量 (IV) 与此算法的块大小不匹配 - Specified initialization vector (IV) does not match the block size for this algorithm 指定的初始化向量 (IV) 与此算法的块大小不匹配 - Specified initialization vector (IV) does not match the block size for this algorithm 使用CryptoStream的“指定的初始化向量(IV)与该算法的块大小不匹配” - “Specified initialization vector (IV) does not match the block size for this algorithm” using an CryptoStream 指定的初始化向量(IV)与使用AES的c#中的块大小不匹配 - Specified initialization vector (IV) does not match the block size in c# using AES AESCrypt如何处理文件格式2的初始化向量(IV)? - How does AESCrypt handle the initialization vector (IV) for file format 2? System.Security.Cryptography.CryptographicException:系统找不到指定的文件 - System.Security.Cryptography.CryptographicException: The system cannot find the file specified System.Security.Cryptography.CryptographicException:'输入数据不是一个完整的块。' - System.Security.Cryptography.CryptographicException: 'The input data is not a complete block.' System.Security.Cryptography.CryptographicException 输入数据不是一个完整的块 - System.Security.Cryptography.CryptographicException The input data is not a complete block
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM