2

I'm unable to reproduce an openssl md5 hash in powershell. The openssl command to generate the md5 hash uses the '-binary' switch and I do not know what the equivalent function in powershell is. Is there a way to reproduce openssl's '-binary' switch in powershell?

Openssl:

md5="$(openssl md5 -binary < "files/$file" | base64)"

Powershell:

$md5 = (Get-FileHash $file -Algorithm md5).hash
$md5base64 = [System.Convert]::ToBase64String($utf8.GetBytes($md5))
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.