Skip to content

Instantly share code, notes, and snippets.

@FelipeGrijo
Last active April 13, 2024 14:48
Show Gist options
  • Save FelipeGrijo/3d8c64ed3e26912f3d35d2fdb35c80e0 to your computer and use it in GitHub Desktop.
Save FelipeGrijo/3d8c64ed3e26912f3d35d2fdb35c80e0 to your computer and use it in GitHub Desktop.
Ver/Comparar hash SHA1, SHA256, SHA384, SHA512, MACTripleDES, MD5, RIPEMD160 PowerShell Win10
# https://gist.github.com/FelipeGrijo
function MenuH
{
param (
[string]$Title = 'Verificar Hash de Arquivos'
)
Write-Host "$Title"
Write-Host "1: Ver"
Write-Host "2: Comparar"
Write-Host "3: Sair"
}
do
{
MenuH
$input = Read-Host "Opção"
switch ($input)
{
'1' {
$LocalArq = Read-Host -Prompt 'Diretório do Arquivo'
$TipoHash = Read-Host -Prompt 'Escolha o Tipo de Hash (SHA1, SHA256, SHA384, SHA512, MACTripleDES, MD5, RIPEMD160)'
Get-FileHash $LocalArq -Algorithm $TipoHash
} '2' {
$PHash1 = Read-Host -Prompt 'Hash 1:'
$SHash2 = Read-Host -Prompt 'Hash 2:'
"$PHash1".equals("$SHash2",1)
} '3' {
return
}
}
pause
}
until ($input -eq '3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment