Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/SharedNetCoreLibrary/Utilities/EncryptionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public static string EncryptStringToBase64String(string plainText, byte[] key, i
return Convert.ToBase64String(returnValue);
}

public static string EncryptStreamToBase64String(MemoryStream stream, byte[] key, int keySize = 256)
=> EncryptStringToBase64String(GetStringFromBase64String(stream.ToArray()), key, keySize);

/// <summary>
/// Decrypts a string with the passed key and returns a plain text string. (#1 + #2)
/// </summary>
Expand Down Expand Up @@ -146,6 +149,8 @@ public static string DecryptStringFromBase64String(string? cipherText, byte[] ke
}
return plaintext;
}
public static string DecryptStreamFromBase64String(MemoryStream stream, byte[] key, int keySize = 256)
=> DecryptStringFromBase64String(GetStringFromBase64String(stream.ToArray()), key, keySize);

/// <summary>
/// This method salts a user password with the provided salt. Make sure to use the same salt for decrypting
Expand Down
Loading