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