mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 00:54:04 +01:00
Update encrypt-file.ps1
This commit is contained in:
parent
a56e58c1cf
commit
b3c23dac12
@ -118,8 +118,9 @@ try {
|
||||
if ($Password -eq "" ) { $Password = read-host "Enter password" }
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
$PasswordBase64 = [System.Convert]::ToBase64String($Password)
|
||||
EncryptFile "$Path" -Algorithm AES -KeyAsPlainText $PasswordBase64 -RemoveSource
|
||||
[char[]]$PasswordAsArray = $Password
|
||||
$PasswordAsBase64 = [System.Convert]::ToBase64String($PasswordAsArray)
|
||||
EncryptFile "$Path" -Algorithm AES -KeyAsPlainText $PasswordAsBase64 -RemoveSource
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ file encrypted in $Elapsed sec"
|
||||
|
Loading…
Reference in New Issue
Block a user