Remove the -AsPlainText switch in Get-KeePassEntry and provide a function to convert a secure string into plain text from the pipeline
Ninjigen opened this issue · comments
It's more of a suggestion than a question, but how about instead of having a Get-KeePassEntry function having a switch to provide the password as plain text, we should provide the with a consistent PSObject having a secure string for a password, and a function which would convert the secure string as plain text ?
The syntax would be something like
$KeePassEntry.Password | ConvertFrom-KeepassPassword
plain password
@Ninjigen, let me think about this some. I agree that this part needs to be redone.
Dragging up an old-ish question, since it bothered me and I just recently started using the module.
As a quick-fix for my own copy of 2.0.4.0, I went and modified this line so I can keep the data secure in memory at the very least. The parts in bold are my addition.
$KeePassPsObject | Add-Member -Name 'Password' -MemberType NoteProperty -Value ($_keepassItem.Strings.ReadSafe('Password') | ConvertTo-SecureString -AsPlainText -Force -ErrorAction SilentlyContinue)