Skip to content

Commit a40114f

Browse files
committed
1 parent 9c51e14 commit a40114f

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

Templates/PowerCommands.zip

1.45 KB
Binary file not shown.

Templates/PowerCommands_devops.zip

25 Bytes
Binary file not shown.

Templates/src/Core/PainKiller.PowerCommands.Security/MANAGERS/AESEncryptionManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public string EncryptString(string plainText, string sharedSecret)
2626
using var aesAlg = Aes.Create();
2727
try
2828
{
29-
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes);
29+
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes, iterations: 1000, HashAlgorithmName.SHA1);
3030
aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
3131
aesAlg.Mode = CipherMode.CBC;
3232

@@ -70,7 +70,7 @@ public string DecryptString(string cipherText, string sharedSecret)
7070
try
7171
{
7272
// generate the key from the shared secret and the salt
73-
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes);
73+
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes, iterations: 1000, HashAlgorithmName.SHA1);
7474

7575
var bytes = Convert.FromBase64String(cipherText);
7676
using var msDecrypt = new MemoryStream(bytes);

src/PainKiller.PowerCommands/Core/PainKiller.PowerCommands.Security/Managers/AESEncryptionManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public string EncryptString(string plainText, string sharedSecret)
2626
using var aesAlg = Aes.Create();
2727
try
2828
{
29-
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes);
29+
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes, iterations: 1000, HashAlgorithmName.SHA1);
3030
aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
3131
aesAlg.Mode = CipherMode.CBC;
3232

@@ -70,7 +70,7 @@ public string DecryptString(string cipherText, string sharedSecret)
7070
try
7171
{
7272
// generate the key from the shared secret and the salt
73-
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes);
73+
var key = new Rfc2898DeriveBytes(sharedSecret, _saltBytes, iterations: 1000, HashAlgorithmName.SHA1);
7474

7575
var bytes = Convert.FromBase64String(cipherText);
7676
using var msDecrypt = new MemoryStream(bytes);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AES/@EntryIndexedValue">AES</s:String>
23
<s:Boolean x:Key="/Default/UserDictionary/Words/=powershell/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)