mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 11:06:33 +00:00
don't send hardware hash, calc on the api
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Azaion.Common.Entities;
|
||||
|
||||
namespace Azaion.Services;
|
||||
|
||||
@@ -10,7 +11,10 @@ public static class Security
|
||||
public static string ToHash(this string str) =>
|
||||
Convert.ToBase64String(SHA384.HashData(Encoding.UTF8.GetBytes(str)));
|
||||
|
||||
public static string MakeEncryptionKey(string email, string password, string? hardwareHash) =>
|
||||
public static string GetHWHash(HardwareInfo hardware) =>
|
||||
$"Azaion_{hardware.MacAddress}_{hardware.CPU}_{hardware.GPU}".ToHash();
|
||||
|
||||
public static string GetApiEncryptionKey(string email, string password, string? hardwareHash) =>
|
||||
$"{email}-{password}-{hardwareHash}-#%@AzaionKey@%#---".ToHash();
|
||||
|
||||
public static async Task EncryptTo(this Stream stream, Stream toStream, string key, CancellationToken cancellationToken = default)
|
||||
|
||||
Reference in New Issue
Block a user