Help please: Using shell for SHA256

Hello,

I use this code for SHA1 …

Dim DroppedItemShellPath as string = TextField1.Text
h=new Shell
h.Execute "/usr/bin/openssl sha1 " + DroppedItemShellPath
s=h.Result

How can I modify that for SHA256 ?

Thanks.

Lennox

Have a look on this page: http://documentation.xojo.com/index.php/Crypto

I’ve seen that but it does not use the shell.

Lennox

You want a checksum for DroppedItemSHellPath using OpenSSL?
This would work.

/usr/bin/openssl dgst -sha256 DroppedItemShellPath

shasum -a 256 DroppedItemShellPath

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/shasum.1.html

Thanks Albin,

h.Execute "/usr/bin/openssl dgst -sha256 " + DroppedItemShellPath works great.

Thanks again.

Lennox

Thanks Michel, I will look at that too.
Lennox

Info: https://www.openssl.org/docs/apps/openssl.html :slight_smile: