Skip to content

Commit ab54c4c

Browse files
committed
update namespace
1 parent 16f2c78 commit ab54c4c

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

src/Encryption/AesEncryption/BaseAesEncryption.cs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
using System;
33
using System.IO;
44
using System.Security.Cryptography;
5+
using System.Text;
56

6-
namespace SafeCrypt.src.Encrypt.AesEncryption
7+
namespace SafeCrypt.AesEncryption
78
{
89
public class BaseAesEncryption
910
{
@@ -100,30 +101,5 @@ public static byte[] DecryptAES(byte[] encryptedData, byte[] key, byte[] iv)
100101
}
101102
}
102103
}
103-
104-
105-
/// <summary>
106-
/// Generates an array of random bytes using a cryptographically secure random number generator.
107-
/// </summary>
108-
/// <param name="length">The length of the byte array to generate.</param>
109-
/// <returns>An array of random bytes or the IV key</returns>
110-
/// <remarks>
111-
/// The method uses a cryptographically secure random number generator (RNGCryptoServiceProvider) to generate
112-
/// a byte array with the specified length, providing a high level of randomness suitable for cryptographic use.
113-
/// </remarks>
114-
/// <param name="length">The desired length of the generated byte array.</param>
115-
/// <returns>An array of random bytes with the specified length.</returns>
116-
/// <exception cref="ArgumentException">
117-
/// Thrown if the specified length is less than or equal to zero.
118-
/// </exception>
119-
public static byte[] GenerateRandomIVKeyAsBytes(int length)
120-
{
121-
byte[] randomBytes = new byte[length];
122-
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
123-
{
124-
rng.GetBytes(randomBytes);
125-
}
126-
return randomBytes;
127-
}
128104
}
129105
}

0 commit comments

Comments
 (0)