You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -228,6 +242,18 @@ public void GetAccountInformation_AuthenticatedUser_Succeeds(string email, strin
228
242
Assert.Equal(1046530+AuthenticatedTestContext.FileSize+AuthenticatedTestContext.SubFolderFileSize,accountInformation.UsedQuota);// 1046530 is from incoming shares
// From https://www.medo64.com/2012/04/pbkdf2-with-sha-256-and-others/
3
+
//2012-04-12: Initial version.
4
+
namespaceMedo.Security.Cryptography
5
+
{
6
+
usingSystem;
7
+
usingSystem.Security.Cryptography;
8
+
usingSystem.Text;
9
+
10
+
/// <summary>
11
+
/// Generic PBKDF2 implementation.
12
+
/// </summary>
13
+
/// <example>This sample shows how to initialize class with SHA-256 HMAC.
14
+
/// <code>
15
+
/// using (var hmac = new HMACSHA256()) {
16
+
/// var df = new Pbkdf2(hmac, "password", "salt");
17
+
/// var bytes = df.GetBytes();
18
+
/// }
19
+
/// </code>
20
+
/// </example>
21
+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly",MessageId="Pbkdf",Justification="Spelling is correct.")]
22
+
publicclassPbkdf2
23
+
{
24
+
25
+
/// <summary>
26
+
/// Creates new instance.
27
+
/// </summary>
28
+
/// <param name="algorithm">HMAC algorithm to use.</param>
29
+
/// <param name="password">The password used to derive the key.</param>
30
+
/// <param name="salt">The key salt used to derive the key.</param>
31
+
/// <param name="iterations">The number of iterations for the operation.</param>
32
+
/// <exception cref="System.ArgumentNullException">Algorithm cannot be null - Password cannot be null. -or- Salt cannot be null.</exception>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance","CA1819:PropertiesShouldNotReturnArrays",Justification="Byte array is proper return value in this case.")]
99
+
publicByte[]Salt{get;privateset;}
100
+
101
+
/// <summary>
102
+
/// Gets iteration count.
103
+
/// </summary>
104
+
publicInt32IterationCount{get;privateset;}
105
+
106
+
/// <summary>
107
+
/// Returns a pseudo-random key from a password, salt and iteration count.
108
+
/// </summary>
109
+
/// <param name="count">Number of bytes to return.</param>
0 commit comments