Change KeyGeneration for MasterPasscode per SRB.
This commit is contained in:
parent
53158787b0
commit
dde35a9c06
@ -432,15 +432,14 @@ namespace sscs.crypto
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
/* Generate passcode using desktop passwd and store
|
byte[] baPasscode;
|
||||||
* it in the passwd file encrypted with the desktop passwd.
|
// use AES to generate a random 16 byte key;
|
||||||
* Encrypt a well-known with the passcode and store it.
|
RijndaelManaged myRijndael = new RijndaelManaged();
|
||||||
* Return the generated passcode.
|
myRijndael.KeySize = 128;
|
||||||
*/
|
//Create a new key and initialization vector.
|
||||||
Random random = new Random(desktopPasswd.GetHashCode());
|
myRijndael.GenerateKey();
|
||||||
int randNum = random.Next();
|
baPasscode = myRijndael.Key;
|
||||||
string randStr = randNum.ToString() + userId.GetUID().ToString();
|
|
||||||
byte[] baPasscode = Generate16ByteKeyFromString(randStr);
|
|
||||||
|
|
||||||
EncryptAndStoreMasterPasscodeUsingString(baPasscode,
|
EncryptAndStoreMasterPasscodeUsingString(baPasscode,
|
||||||
desktopPasswd,
|
desktopPasswd,
|
||||||
|
Loading…
Reference in New Issue
Block a user