Saved password security

This commit is contained in:
Kayomani
2015-08-07 20:09:13 +01:00
parent fa8d2a3705
commit 3bdf3c8a6a
44 changed files with 340 additions and 62 deletions

View File

@@ -19,6 +19,7 @@ namespace Jackett.Models.Config
public bool AllowExternal { get; set; }
public string APIKey { get; set; }
public string AdminPassword { get; set; }
public string InstanceId { get; set; }
public string[] GetListenAddresses(bool? external = null)
{
@@ -38,19 +39,5 @@ namespace Jackett.Models.Config
};
}
}
public string GenerateApi()
{
var chars = "abcdefghijklmnopqrstuvwxyz0123456789";
var randBytes = new byte[32];
var rngCsp = new RNGCryptoServiceProvider();
rngCsp.GetBytes(randBytes);
var key = "";
foreach (var b in randBytes)
{
key += chars[b % chars.Length];
}
return key;
}
}
}