mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 15:07:03 +01:00
Control Panel login screen improvements
Allows saving of remote access password Remote access button selected by default if used last Tabbing through the page now goes in a sane fashion
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace TGServerService
|
||||
{
|
||||
@@ -61,24 +60,6 @@ namespace TGServerService
|
||||
}
|
||||
}
|
||||
|
||||
public static string EncryptData(byte[] data, out string sentropy)
|
||||
{
|
||||
// Generate additional entropy (will be used as the Initialization vector)
|
||||
byte[] entropy = new byte[20];
|
||||
using (var rng = new RNGCryptoServiceProvider())
|
||||
rng.GetBytes(entropy);
|
||||
|
||||
byte[] ciphertext = ProtectedData.Protect(data, entropy, DataProtectionScope.CurrentUser);
|
||||
|
||||
sentropy = Convert.ToBase64String(entropy, 0, entropy.Length);
|
||||
return Convert.ToBase64String(ciphertext, 0, ciphertext.Length);
|
||||
}
|
||||
|
||||
public static byte[] DecryptData(string data, string entropy)
|
||||
{
|
||||
return ProtectedData.Unprotect(Convert.FromBase64String(data), Convert.FromBase64String(entropy), DataProtectionScope.CurrentUser);
|
||||
}
|
||||
|
||||
public static void CopyDirectory(string sourceDirName, string destDirName, IList<string> ignore = null, bool ignoreIfNotExists = false)
|
||||
{
|
||||
// If the destination directory doesn't exist, create it.
|
||||
|
||||
Reference in New Issue
Block a user