Last active
December 15, 2015 20:58
-
-
Save joekarma/5321929 to your computer and use it in GitHub Desktop.
sha512 password digesting function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun 5-random-base64-encoded-bytes () | |
(base64:usb8-array-to-base64-string | |
(map 'vector (lambda (place) | |
(declare (ignore place)) | |
(random 255)) | |
(make-sequence 'vector 5)))) | |
(defun digest-password (password &optional (salt (5-random-base64-encoded-bytes))) | |
(values | |
(base64:usb8-array-to-base64-string | |
(ironclad:digest-sequence 'ironclad::sha512 | |
(babel:string-to-octets (concatenate 'string password salt)))) | |
salt)) |
zkat
commented
Apr 5, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment