This commit is contained in:
Christian
2017-10-11 14:43:49 +02:00
parent d75de01e94
commit 59ac6c99d3
59 changed files with 9703 additions and 3459 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using BeWo.Data.Security;
using BS.Shared;
namespace BeWo.Data.Entities
@@ -25,7 +26,9 @@ namespace BeWo.Data.Entities
public static string PropertyName_Zeitstempel = "TimeStamp";
private readonly byte[] _Rc2IV = {35, 138, 177, 253, 227, 63, 2, 27};
public static string PropertyName_BCryptPassword = "BCryptPassword";
private readonly byte[] _Rc2IV = {35, 138, 177, 253, 227, 63, 2, 27};
private readonly byte[] _Rc2Key = {174, 130, 219, 185, 185, 221, 96, 50, 37, 212, 81, 121, 71, 206, 130, 153};
@@ -33,7 +36,9 @@ namespace BeWo.Data.Entities
private string _HashedPassword;
private string _LoginName;
private string _BCryptPassword;
private string _LoginName;
private IList<ResetPasswordInfo> _ResetPasswordInfos;
private string _Salt;
@@ -76,7 +81,20 @@ namespace BeWo.Data.Entities
}
}
public virtual string LoginName
public virtual string BCryptPassword
{
get { return _BCryptPassword; }
set
{
if (AreDifferent(_BCryptPassword, value))
{
_BCryptPassword = value;
}
}
}
public virtual string LoginName
{
get { return _LoginName; }
@@ -177,7 +195,11 @@ namespace BeWo.Data.Entities
string lHash = BitConverter.ToString(lMD5.ComputeHash(Encoding.UTF8.GetBytes(String.Format("{0}_{1}_{2}", Salt, pPassword, "o238rRndguK4Fh8dsfkhwon54H8n3qo4itv8nz3o4LvnzQs0npmwEp"))));
lHash = BitConverter.ToString(lMD5.ComputeHash(Encoding.UTF8.GetBytes(lHash)));
HashedPassword = lHash;
}
//BCrypt
string salt = BCrypt.GenerateSalt();
BCryptPassword = BCrypt.HashPassword(pPassword, salt);
}
public virtual bool CheckRC2Password(string pRC2Hash)
{