ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to calculate Checksum SHA-256

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to calculate Checksum SHA-256

    I am currently working on an iSeries OS version V5R4M000. Is there a way to calculate the SHA-256 checksum for a file in the IFS?

    Some examples I have found include the following commands:
    CALL QP2TERM
    echo "Hello World" | openssl sha1

    Or to calculate the hash of a stream file in the IFS, you can use the following syntax:
    openssl sha1 < /xxx/yyy/mystream.file

    However, I don't see any support for SHA-256.
    And by the way... how can I perform a search in the forums? It seems like basic functionality but I don't see the option.


  • #2
    As of 7.3, this works in QSH: openssl sha256 {fileName} The big question is, does v5r4 do SHA-256?

    Comment


  • #3
    jtaylor is confusing IBM's TLS implementation with that of OpenSSL. Two different things.

    It may be possible to make a more recent version of OpenSSL run in V5R4 PASE. To do that, you'd need to find a copy that has been compiled for AIX (or IBM i PASE) at a level that is compatible with your OS. Or compile it yourself. Either way, you'll need to install it yourself.

    V5R4 is ridiculously old and unsupported, so you won't get help from IBM, and I doubt very much that anyone else out here has tried to make this work on IBM i on such an old release, but, who knows? And, nothing is stopping you from doing it yourself.

    Or, obviously, you could find differnet SHA-256 software besides OpenSSL.

    Comment


    • #4
      The Calculate Hash API (of the Cryptographic Services APIs) appears to support sha-256 on v5r4. I haven't tried it (I don't have a system that old to try it with) but it should work for you.

      Comment

      Working...
      X