private static byte[] GetKeyfileBytes(byte[] passwordBytes) { if (!string.IsNullOrEmpty(Globals.KeyfilePath)) { byte[] keyfileBytes = Keyfiles.ReadKeyfile(Globals.KeyfilePath); if (keyfileBytes != null) { MemoryEncryption.DecryptByteArray(ref passwordBytes); // Combine password and keyfile bytes passwordBytes = HashingAlgorithms.Blake2(passwordBytes, keyfileBytes); MemoryEncryption.EncryptByteArray(ref passwordBytes); Utilities.ZeroArray(keyfileBytes); } } return(passwordBytes); }
private static byte[] KeyfileAsPassword() { // If only a keyfile was selected, use the keyfile bytes as the password byte[] passwordBytes = Keyfiles.ReadKeyfile(Globals.KeyfilePath); return(HashPasswordBytes(passwordBytes)); }
private void TsmiSelectKeyfile_Click(object sender, EventArgs e) { bool keyfileSelected = Keyfiles.SelectKeyfile(); KeyfileSelected(keyfileSelected); }
private void TsmiCreateKeyFile_Click(object sender, EventArgs e) { bool keyfileGenerated = Keyfiles.CreateKeyfile(); KeyfileSelected(keyfileGenerated); }