diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs
index d9191610..e9fe25aa 100644
--- a/DepotDownloader/ContentDownloader.cs
+++ b/DepotDownloader/ContentDownloader.cs
@@ -244,7 +244,7 @@ namespace DepotDownloader
byte[] manifest_bytes;
try
{
- manifest_bytes = CryptoHelper.SymmetricDecryptECB(input, appBetaPassword);
+ manifest_bytes = Util.SymmetricDecryptECB(input, appBetaPassword);
}
catch (Exception e)
{
diff --git a/DepotDownloader/Util.cs b/DepotDownloader/Util.cs
index d249c1fc..39af1aeb 100644
--- a/DepotDownloader/Util.cs
+++ b/DepotDownloader/Util.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
+using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
@@ -133,6 +134,23 @@ namespace DepotDownloader
).ToString();
}
+ ///
+ /// Decrypts using AES/ECB/PKCS7
+ ///
+ public static byte[] SymmetricDecryptECB(byte[] input, byte[] key)
+ {
+ using var aes = Aes.Create();
+ aes.BlockSize = 128;
+ aes.KeySize = 256;
+ aes.Mode = CipherMode.ECB;
+ aes.Padding = PaddingMode.PKCS7;
+
+ using var aesTransform = aes.CreateDecryptor(key, null);
+ var output = aesTransform.TransformFinalBlock(input, 0, input.Length);
+
+ return output;
+ }
+
public static async Task InvokeAsync(IEnumerable> taskFactories, int maxDegreeOfParallelism)
{
ArgumentNullException.ThrowIfNull(taskFactories);