DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Encryption

 4 Replies
 2 Subscribed to this topic
 34 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 60
Growing Member
New Poster
New Poster
Congrats on posting!

We have a module where we used to encrypt some parameters with something like this:

string serialized = serializeParameters();
string qs = DotNetNuke.Common.Utilities.UrlUtils.EncryptParameter(serialized);
return QS_NAVIGATE + "=" + HttpContext.Current.Server.UrlEncode(qs);

This was the used on a URL similar to www.domain.com/somepath/encryptedparams=xxxxxxxxxxxxxx

This was working fine until we moved to DNN 10. Now all previous urls that were generated are broken, if we run the same code on DNN 10, we get a different encrypted string.

Is this a known feature? Because I'd consider this a breaking change.


 

Vicenç Masanas
Disgrafic ITec SL Banyoles - Spain
Growing Member
Posts: 89
Growing Member

Are you running DNN10 on the same machine? Is your ASP.NET machinekey the same?

https://learn.microsoft.c...view=aspnetcore-10.0

 

Growing Member
Posts: 60
Growing Member
New Poster
New Poster
Congrats on posting!

Yes to both. It was a standard DNN upgrade and the machine key didn't change.

Vicenç Masanas
Disgrafic ITec SL Banyoles - Spain
Growing Member
Posts: 89
Growing Member

In case it helps... an AI generated response, so may not be entirely accurate...

Yes, older and newer versions of <code>DotNetNuke.Abstractions.Security.ICryptographyProvider.EncryptParameter</code> will produce different encrypted results.

The core reason is that the underlying encryption implementation has changed across DNN versions to fix security vulnerabilities, not because of the interface definition itself. Here's a breakdown of the key differences:

1. Known Vulnerabilities Led to Algorithm Changes

DNN versions 9.2 through 9.2.2 were found to use a weak encryption algorithm to protect input parameters. Additionally, these versions incorrectly converted encryption key source values, resulting in lower-than-expected entropy.

To fix these issues (CVEs), DNN had to update its encryption implementation in later versions. The fixes were incomplete in some cases, leading to further changes. This means the actual encryption logic—and thus the output—changed between versions.

2. Changes to the Underlying Machine Key

<code>EncryptParameter</code> relies on the machine key configured in your <code>web.config</code> file (specifically, the <code>ValidationKey</code> and <code>DecryptionKey</code>).

  • Older DNN versions often shipped with default, embedded machine keys in their <code>web.config</code>.

  • Newer versions, especially those addressing the CVEs above, have updated their default machine key handling and best practices.

If the machine key used for encryption differs between your old and new environments, the encrypted output will be different, even if the code logic were identical.

3. The Interface vs. The Implementation

<code>ICryptographyProvider</code> is just an interface (contract) defined in the <code>DotNetNuke.Abstractions</code> assembly. It doesn't contain any encryption logic itself. The actual encryption is performed by a concrete implementation of this interface, which is part of the DNN Platform's core library (<code>DotNetNuke.dll</code>).

As the platform evolved, these concrete implementations were updated to use stronger algorithms (like AES) and better key derivation practices.

Summary

Aspect Older Versions (e.g., 9.2.x) Newer Versions (e.g., 9.4+)
Encryption Algorithm Weak, vulnerable to known issues Stronger, patched algorithms
Key Handling Incorrect conversion, low entropy Corrected conversion, higher entropy
Default Machine Key Often hardcoded and exposed Improved default handling and best practices
Encrypted Output Different Different

Recommendations

  1. Do not rely on <code>EncryptParameter</code> for cross-version compatibility. It is not designed to produce consistent, version-agnostic encrypted strings.

  2. If you need consistent encryption across environments, implement your own dedicated encryption method using a stable algorithm (like AES) with a fixed, explicitly managed key and initialization vector (IV) that you control.

  3. When upgrading DNN, be aware that any encrypted parameters generated by the old version may not be decryptable by the new version, and vice-versa. Plan to re-encrypt any such data as part of your upgrade process.

In short, the answer is a definitive yes—older and newer versions will produce different encrypted results due to fundamental security fixes and implementation changes within the DNN platform.

This response is AI-generated, for reference only.

Growing Member
Posts: 60
Growing Member
New Poster
New Poster
Congrats on posting!

That's helpfull, thank you!

Vicenç Masanas
Disgrafic ITec SL Banyoles - Spain

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved