I'm trying to make VC as user-friendly as possible for encrypted volumes (not drives/system), for users who are the lowest end of the tech-savvy spectrum.
I'm happy to take the user's p/w at the time they create the volume and pass it through the command line just that once.
I'm less keen to do that every time they want to open it again later, but I also don't want them being confused by KDF, PIM and whatnot. Or clicking on them!
Is there a way to get VC just to ask for the password, and not give the user any of the other options?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not aware of any means to coerce the VeraCrypt GUI into limiting the options that unfamiliar users sometimes find daunting. An alternative would be to create a script that automatically includes all of the desired mounting options except the password, collecting the password instead via a single item dialog to the user, and then passing all of these items to VeraCrypt in a command line. That avoids including the cleartext password in the script, and you won't have to instruct users in VeraCrypt usage. If you are familiar with PowerShell scripting, I wrote a password dialog function that might fill the bill if you're interested.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Paul,
I wrote this as an example when I was auditioning scripting languages to replace the soon-to-be deprecated VBScript. PowerShell won out. Anyway, just copy the entire block of code and paste it into a text file with the .ps1 extension. Run it to make sure this dialog is acceptable, and then add your own code at the end to execute VeraCrypt from the command line using the $Password variable along with your other chosen options (quick link).
FunctionGetPassword{$Form=New-ObjectSystem.Windows.Forms.Form$Form.StartPosition=[System.Windows.Forms.FormStartPosition]::CenterScreen$Form.FormBorderStyle=[System.Windows.Forms.FormBorderStyle]::FixedDialog$Form.MaximizeBox=$False$Form.MinimizeBox=$False$Form.BackColor="LightGray"$Form.Font=New-ObjectSystem.Drawing.Font("Arial",12)$Form.Text="And the password is..."$Form.Width=480$Form.Height=110$TextBox=New-ObjectSystem.Windows.Forms.TextBox$TextBox.Left=10$TextBox.Top=20$TextBox.Width=280$TextBox.PasswordChar='?'$TextBox.Add_KeyDown({Param($sender,$e)If($e.KeyCode-eq[System.Windows.Forms.Keys]::Enter){$e.Handled=$True#prevents any unwanted further handling of the event$e.SuppressKeyPress=$true#prevents newline character being added to input stringNew-Variable-NamePasswordText-Value($TextBox.Text)-ScopeScript$Form.Dispose()}})$Form.Controls.Add($TextBox)$ButtonTop=20$ButtonWidth=70$ButtonHeight=28$Button=New-ObjectSystem.Collections.ArrayListFor($X=0;$X-lt2;$X++){$TempButton=New-ObjectSystem.Windows.Forms.Button$Button.Add($TempButton)$Button[$X].Location=New-ObjectSystem.Drawing.Point((304+(($ButtonWidth+10)*$X)),$ButtonTop)$Button[$X].Width=$ButtonWidth$Button[$X].Height=$ButtonHeight#???$Button[$X].BackColor="White"$Button[$X].Add_Click({Param($sender)If(($sender.Text-eq'Show')){$sender.Text='Mask'$TextBox.PasswordChar=0}ElseIf(($sender.Text-eq'Mask')){$sender.Text='Show'$TextBox.PasswordChar='?'}ElseIf(($sender.Text-eq"Copy")){Set-Clipboard-Value$TextBox.Text}$TextBox.Focus()})$Form.Controls.Add($Button[$X])}$Button[0].Text="Show"$Button[1].Text="Copy"$Form.ShowDialog()$RetVal=$PasswordTextRemove-Variable-NamePasswordText-ScopeScriptReturn$RetVal}#End_GetPassword$PW=GetPassword$Password=$PW[$PW.Count-1]#This trick filters out excess garbage returned from pipeline#This merely verifies correct assignment of text to the $Password variableAdd-Type-AssemblyName"PresentationFramework"[System.Windows.MessageBox]::Show("String value entered was `"$Password`"")#So now you have the variable $Password to use in your command line invocation of VeraCrypt from a PowerShell script!#Add your own code below this line.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to make VC as user-friendly as possible for encrypted volumes (not drives/system), for users who are the lowest end of the tech-savvy spectrum.
I'm happy to take the user's p/w at the time they create the volume and pass it through the command line just that once.
I'm less keen to do that every time they want to open it again later, but I also don't want them being confused by KDF, PIM and whatnot. Or clicking on them!
Is there a way to get VC just to ask for the password, and not give the user any of the other options?
I'm not aware of any means to coerce the VeraCrypt GUI into limiting the options that unfamiliar users sometimes find daunting. An alternative would be to create a script that automatically includes all of the desired mounting options except the password, collecting the password instead via a single item dialog to the user, and then passing all of these items to VeraCrypt in a command line. That avoids including the cleartext password in the script, and you won't have to instruct users in VeraCrypt usage. If you are familiar with PowerShell scripting, I wrote a password dialog function that might fill the bill if you're interested.
Hi Gary, thank you, that's exactly what I'm looking for.
Happy with PowerShell scripting, please let me have your function, that would be great!
Hi Paul,
I wrote this as an example when I was auditioning scripting languages to replace the soon-to-be deprecated VBScript. PowerShell won out. Anyway, just copy the entire block of code and paste it into a text file with the .ps1 extension. Run it to make sure this dialog is acceptable, and then add your own code at the end to execute VeraCrypt from the command line using the $Password variable along with your other chosen options (quick link).
Fantastic, thank you! That's going to be very helpful :-)
Happy to be of service!