Chariot Training Classes

Training Courses

I run Chariot's training and mentoring services. We provide training in AngularJS, HTML5, Spring, Hibernate, Maven, Scala, and more.

Chariot Education Services


Chariot Emerging Tech

Learn about upcoming technologies and trends from my colleagues at Chariot Solutions.


Chariot Conferences


Entries in osx (1)


Quizzo in Roo - Security, SHA-256 and OS X

On OS X, there is no sha256sum utility, but a more generic one, shasum. This is good, but it takes standard input or a file, each of which will end up appending a newline on OS X.

Here was the workaround I found (thank you to this Stack Overflow thread).

echo -n passwd|shasum -a256

The -n flag strips the newline. The value I got for 'passwd' was 0d6be69b264717f2dd33652e212b173104b4a647b7c11ae72e9885f11cd312fb. Next, you can put the secure hash in applicationContext-security.xml like this:

    <password-encoder hash="sha-256" />
        <user name="admin"
          authorities="ROLE_ADMIN,ROLE_USER" />
        <user name="user"
          authorities="ROLE_USER" />

On Unix systems, you'll be able to use sha256sum, presumably with the same echo -n input.