RSS Feed

Lisp Project of the Day

crypto-shortcuts

You can support this project by donating at:

Donate using PatreonDonate using Liberapay

crypto-shortcutssecurityutils

Documentation😀
Docstrings😀
Tests 🥺
Examples😀
RepositoryActivity🥺
CI 🥺

Crypto-shortcuts serves a single purpose - to reduce an amount of headache when you have to encrypt, decrypt or make some kind of hash.

This @Shinmera's library has a nice documentation. Today I lack time, so here is the only one example of making a sha256 hash out of string.

This code which uses plain flexi-streams and ironclad:

POFTHEDAY> (let* ((octets (flexi-streams:string-to-octets
                           "Hello World!"
                           :external-format :utf-8))
                  (digest (ironclad:digest-sequence
                           'ironclad:sha256
                           octets)))
             (ironclad:byte-array-to-hex-string digest))
"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"

Compare it with the code, using crypto-shortcuts:

POFTHEDAY> (cryptos:sha256 "Hello World!")
"7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"

This library definitely should be in a toolbox of any common-lisper!


Brought to you by 40Ants under Creative Commons License