Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6101147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:28:01+00:00 2026-05-23T13:28:01+00:00

We have a legacy ASP.NET site which uses the encryption methods here: http://www.codekeep.net/snippets/af1cd375-059a-4175-93d7-25eea2c5c660.aspx When

  • 0

We have a legacy ASP.NET site which uses the encryption methods here:

http://www.codekeep.net/snippets/af1cd375-059a-4175-93d7-25eea2c5c660.aspx

When we call the following method, the page loads very slowly and eventually Connection Reset is returned:

Decrypt(" ", true);

If the method is called multiple times in subsequent page requests, the Application Pool goes down.

This is occurring on a Windows 2008 server running .NET framework v3.5.

I narrowed the problem down to the TransformFinalBlock() call.

NOTE: on Cassini, I do not get a connection timeout; instead the following exception is thrown:

System.Security.Cryptography.CryptographicException: Bad Data

Calling Decrypt() for other strings causes no problems in any environment.

Why is this happening? Is it a bug in TripleDESCryptoServiceProvider?

Obviously, I could filter the cipherString to reject ” ” and avoid this particular issue. However, I am worried that some other cipherString values that I am not suspecting will cause the DoS.

UPDATE 2011.06.28

The following is the minimal code to reproduce the issue:

// problem occurs when toEncryptArray is an empty array {}
      byte[] toEncryptArray = {};

      MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
      byte[] keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes("dummy_key"));
      hashmd5.Clear();

      TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
      tdes.Key = keyArray;
      tdes.Mode = CipherMode.ECB;
      tdes.Padding = PaddingMode.PKCS7;
      ICryptoTransform cTransform = tdes.CreateDecryptor();

      // the following line can crashes the ASP.NET Application Pool (may need to call multiple times).
      byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);

      tdes.Clear();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:28:01+00:00Added an answer on May 23, 2026 at 1:28 pm

    The issue, as mentioned above, is that the decryption logic does not properly handle the case where the input cipher is a zero-length array.

    A ticket was created for this:

    http://connect.microsoft.com/VisualStudio/feedback/details/678150/denial-of-service-in-tripledescryptoserviceprovider

    Note, it seems to work OK when running .NET framework 4.0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a legacy ASP.net powered site running on a IIS server, the site
I have a legacy (haha) ASP.Net Webforms Web Site Project in Visual Studio 2008
I have legacy asp.net 1.1 website. It has a very poor VB layered achitecture.
I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding
I'm working on an asp.net web site. We have to use com interop to
I have a legacy C++ module that offers encryption/decryption using the openssl library (DES
We have some legacy code that needs to identify in the Page_Load which event
I have a legacy C++ application that uses DDS for asynchronous communication/messaging. I need
I have a legacy VB6 program which installs an Access file in a sub-directory
I'm working on a web site where the new pages are ASP.NET and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.