This is the crypto-shortcuts Reference Manual, version 2.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:54:51 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
crypto-shortcuts
Shorthand functions for common cryptography tasks such as hashing, encrypting, and encoding.
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shinmera/crypto-shortcuts.git)
zlib
2.0.0
ironclad
(system).
cl-base64
(system).
cl-base32
(system).
flexi-streams
(system).
package.lisp
(file).
encode.lisp
(file).
crypto.lisp
(file).
hashing.lisp
(file).
digests.lisp
(file).
totp.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
crypto-shortcuts/crypto-shortcuts.asd
crypto-shortcuts/package.lisp
crypto-shortcuts/encode.lisp
crypto-shortcuts/crypto.lisp
crypto-shortcuts/hashing.lisp
crypto-shortcuts/digests.lisp
crypto-shortcuts/totp.lisp
crypto-shortcuts/documentation.lisp
crypto-shortcuts/crypto-shortcuts.asd
crypto-shortcuts
(system).
crypto-shortcuts/encode.lisp
package.lisp
(file).
crypto-shortcuts
(system).
code
(generic function).
from-base32
(generic function).
from-base64
(generic function).
from-hex
(generic function).
to
(generic function).
to-base32
(generic function).
to-base64
(generic function).
to-hex
(generic function).
to-octets
(generic function).
to-string
(generic function).
crypto-shortcuts/crypto.lisp
encode.lisp
(file).
crypto-shortcuts
(system).
cmac
(generic function).
decrypt
(generic function).
encrypt
(generic function).
get-cipher
(generic function).
hmac
(generic function).
normalize-key
(generic function).
crypto-shortcuts/hashing.lisp
crypto.lisp
(file).
crypto-shortcuts
(system).
check-rfc-2307-hash
(function).
make-salt
(generic function).
pbkdf2-hash
(function).
pbkdf2-key
(function).
rfc-2307-hash
(function).
simple-hash
(function).
%rfc-2307-hash
(function).
split
(function).
crypto-shortcuts/digests.lisp
hashing.lisp
(file).
crypto-shortcuts
(system).
adler32
(function).
blake2
(function).
blake2/160
(function).
blake2/256
(function).
blake2/384
(function).
blake2s
(function).
blake2s/128
(function).
blake2s/160
(function).
blake2s/224
(function).
crc24
(function).
crc32
(function).
find-digest
(function).
groestl
(function).
groestl/224
(function).
groestl/256
(function).
groestl/384
(function).
jh
(function).
jh/224
(function).
jh/256
(function).
jh/384
(function).
keccak
(function).
keccak/224
(function).
keccak/256
(function).
keccak/384
(function).
kupyna
(function).
kupyna/256
(function).
md2
(function).
md4
(function).
md5
(function).
ripemd-128
(function).
ripemd-160
(function).
sha1
(function).
sha224
(function).
sha256
(function).
sha3
(function).
sha3/224
(function).
sha3/256
(function).
sha3/384
(function).
sha384
(function).
sha512
(function).
shake128
(function).
shake256
(function).
skein1024
(function).
skein1024/384
(function).
skein1024/512
(function).
skein256
(function).
skein256/128
(function).
skein256/160
(function).
skein256/224
(function).
skein512
(function).
skein512/128
(function).
skein512/160
(function).
skein512/224
(function).
skein512/256
(function).
skein512/384
(function).
sm3
(function).
streebog
(function).
streebog/256
(function).
tiger
(function).
tree-hash
(function).
whirlpool
(function).
define-digest-wrapper
(macro).
crypto-shortcuts/totp.lisp
digests.lisp
(file).
crypto-shortcuts
(system).
decode-totp-uri
(function).
totp
(function).
totp-uri
(function).
url-decode
(function).
url-encode
(function).
crypto-shortcuts/documentation.lisp
totp.lisp
(file).
crypto-shortcuts
(system).
setdocs
(macro).
Packages are listed by definition order.
crypto-shortcuts
org.shirakumo.crypto-shortcuts
cryptos
common-lisp
.
adler32
(function).
blake2
(function).
blake2/160
(function).
blake2/256
(function).
blake2/384
(function).
blake2s
(function).
blake2s/128
(function).
blake2s/160
(function).
blake2s/224
(function).
check-rfc-2307-hash
(function).
cmac
(generic function).
code
(generic function).
crc24
(function).
crc32
(function).
decode-totp-uri
(function).
decrypt
(generic function).
encrypt
(generic function).
find-digest
(function).
from-base32
(generic function).
from-base64
(generic function).
from-hex
(generic function).
get-cipher
(generic function).
groestl
(function).
groestl/224
(function).
groestl/256
(function).
groestl/384
(function).
hmac
(generic function).
jh
(function).
jh/224
(function).
jh/256
(function).
jh/384
(function).
keccak
(function).
keccak/224
(function).
keccak/256
(function).
keccak/384
(function).
kupyna
(function).
kupyna/256
(function).
make-salt
(generic function).
md2
(function).
md4
(function).
md5
(function).
normalize-key
(generic function).
pbkdf2-hash
(function).
pbkdf2-key
(function).
rfc-2307-hash
(function).
ripemd-128
(function).
ripemd-160
(function).
sha1
(function).
sha224
(function).
sha256
(function).
sha3
(function).
sha3/224
(function).
sha3/256
(function).
sha3/384
(function).
sha384
(function).
sha512
(function).
shake128
(function).
shake256
(function).
simple-hash
(function).
skein1024
(function).
skein1024/384
(function).
skein1024/512
(function).
skein256
(function).
skein256/128
(function).
skein256/160
(function).
skein256/224
(function).
skein512
(function).
skein512/128
(function).
skein512/160
(function).
skein512/224
(function).
skein512/256
(function).
skein512/384
(function).
sm3
(function).
streebog
(function).
streebog/256
(function).
tiger
(function).
to
(generic function).
to-base32
(generic function).
to-base64
(generic function).
to-hex
(generic function).
to-octets
(generic function).
to-string
(generic function).
totp
(function).
totp-uri
(function).
tree-hash
(function).
whirlpool
(function).
%rfc-2307-hash
(function).
define-digest-wrapper
(macro).
setdocs
(macro).
split
(function).
url-decode
(function).
url-encode
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Turn a string into a ADLER32-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2/160-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2S-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2S/128-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2S/160-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a BLAKE2S/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Returns T if the PASSWORD matches the HASH encoded in the scheme defined in RFC2307.
See RFC-2307-HASH
Turn a string into a CRC24-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a CRC32-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Decodes a TOTP parameter URI
Returns a list of the same argument list structure as TOTP-URI.
This URL is according to Google’s Authenticator scheme as described in https://github.com/google/google-authenticator/wiki/Key-Uri-Format
See TOTP-URI
Turn a string into a GROESTL-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a GROESTL/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a GROESTL/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a GROESTL/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a JH-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a JH/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a JH/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a JH/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a KECCAK-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a KECCAK/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a KECCAK/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a KECCAK/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a KUPYNA-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a KUPYNA/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a MD2-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a MD4-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a MD5-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Hasehs PASSWORD with SALT using the PBKDF2 method and the provided DIGEST, repeating the process ITERATION times.
The returned hash is encoded using the method specified in TO.
The default DIGEST is SHA512, the iteration is 1000, and TO is HEX.
Four values are returned: hash, salt (as a string), digest, and iterations.
See TO.
Hashes PASSWORD with SALT using the PBKDF2 method and the provided DIGEST, repeating the process ITERATION times.
The default DIGEST is SHA512, and the iteration is 1000.
Four values are returned: hash as an octet-vector, salt (as a string), digest, and iterations.
LEGACY. Use PBKDF2-HASH instead.
Hashes PASSWORD with METHOD according to the scheme defined in RFC2307.
The returned hash will be a string of the format:
{method}base64hash
If SALT is passed, or the method is a salted one (sDIGEST), then the salt is
returned as a secondary value and included in the hash. The hash is thus
computed as follows, where no salt is an empty salt sequence.
base64(digest(password+salt)+salt)
An extension is provided to the standard, wherein extra parameters can
be supplied to the hashing mechanism via commas after the method
name. For most hashes this is just the iteration count, which is
omitted if the count is 1. For PBKDF2, this also includes the actual
digest method used.
See CHECK-RFC-2307-HASH
Turn a string into a RIPEMD-128-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a RIPEMD-160-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA1-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA3-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA3/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA3/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA3/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHA512-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHAKE128-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SHAKE256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Hashes PASSWORD with SALT using DIGEST as the digest-method and repeats the hashing ITERATIONS times.
The returned hash is encoded using the method specified in TO.
The default DIGEST is SHA512, the iteration is 1000, and TO is HEX.
Four values are returned: hash, salt (as a string), digest, and iterations.
See TO.
Turn a string into a SKEIN1024-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN1024/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN1024/512-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN256/128-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN256/160-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN256/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN512-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN512/128-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN512/160-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN512/224-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN512/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SKEIN512/384-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a SM3-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a STREEBOG-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a STREEBOG/256-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a TIGER-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Computes a Timed One Time Password for the given secret key.
TIME should be the universal-time for which the OTP is computed.
DIGEST should be the HMAC inner digest used, default being SHA1.
PERIOD should be how long the OTP is valid for in seconds, default
being 30.
DIGITS should be the number of digits for the OTP, default being 6.
Returns the OTP as an integer. If presenting to the user, you should
pad the integer with zeroes to the required number of digits.
The code is computed according to RFC6238
See TOTP-URI
Computes a URI to exchange the TOTP parameters with an external authenticator app.
You will most likely want to encode the returned URI into a QR code to
let the user scan it with a phone or other app more easily.
The ACCOUNT should be some identifier for the user account this URI is
for. Typically a username or email address.
You should pass the ISSUER argument to identify the service that is
using the TOTP.
If no explicit SECRET is passed, one will be generated for you and
is returned as the secondary value. You MUST store this secret
somewhere and use it to compute the TOTP.
You must pass the exact same parameters as you intend to use for the
TOTP generation, as otherwise the authenticator application will not
generate the same codes as you, and verification will fail.
This URL is according to Google’s Authenticator scheme as described in
https://github.com/google/google-authenticator/wiki/Key-Uri-Format
See TOTP
Turn a string into a TREE-HASH-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Turn a string into a WHIRLPOOL-hash.
TO is the returned representation ENCODE is the encoding before hashing ITERATIONS is the number of times to hash
See TO.
Generate a CMAC digest of TEXT using KEY and the provided CIPHER/MODE/IV.
The returned digest is encoded by the format specified in TO.
The default cipher is AES, default mode is ECB, and default TO is BASE64.
Four values are returned: digest, key, cipher, mode, and IV.
See TO
See NORMALIZE-KEY
Convenience function to de/encode in one pass.
By default, FROM and TO can both be one of:
:OCTETS :STRING :HEX :BASE64 :BASE32
If FROM is NIL, then TO is called with the remaining arguments.
(eql nil)
) to vector) ¶(eql :octets)
) (to (eql :octets)
) vector) ¶(eql :octets)
) (to (eql :string)
) vector) ¶(eql :octets)
) (to (eql :hex)
) vector) ¶(eql :octets)
) (to (eql :base64)
) vector) ¶(eql :octets)
) (to (eql :base32)
) vector) ¶(eql :string)
) (to (eql :octets)
) vector) ¶(eql :string)
) (to (eql :string)
) vector) ¶(eql :string)
) (to (eql :hex)
) vector) ¶(eql :string)
) (to (eql :base64)
) vector) ¶(eql :string)
) (to (eql :base32)
) vector) ¶(eql :hex)
) (to (eql :octets)
) vector) ¶(eql :hex)
) (to (eql :string)
) vector) ¶(eql :hex)
) (to (eql :hex)
) vector) ¶(eql :hex)
) (to (eql :base64)
) vector) ¶(eql :hex)
) (to (eql :base32)
) vector) ¶(eql :base64)
) to vector) ¶(eql :base32)
) to vector) ¶Decrypt TEXT with KEY using the provided CIPHER/MODE/IV.
Depending on the mode, the key should be of length 16, 32, or 64.
The passed text is decoded by the format specified in FROM.
The default cipher is AES, default mode is ECB, and default TO is BASE64.
Four values are returned: Decrypted text, key, cipher, mode, and IV.
See CODE
See NORMALIZE-KEY
Encrypt TEXT with KEY using the provided CIPHER/MODE/IV.
Depending on the mode, the key should be of length 16, 32, or 64.
The returned encrypted vector is encoded by the format specified in TO.
The default cipher is AES, default mode is ECB, and default TO is BASE64.
Four values are returned: Encrypted&encoded text, key, cipher, mode, and IV.
See TO
See NORMALIZE-KEY
Turns a base32-encoded vector into a vector encoded by TO. See TO.
Turns a base64-encoded vector into a vector encoded by TO. See TO.
Turn the hex-string into an octet-vector.
string
)) ¶Return the corresponding cipher with KEY using MODE and potentially the initialization-vector IV.
Generate an HMAC digest of TEXT using KEY and the provided DIGEST method.
The returned digest is encoded by the format specified in TO.
The default digest is SHA512, and default TO is BASE64.
Three values are returned: digest, key, and digest-type.
See TO
Create a salt from the given object.
(eql T) – A random salt
INTEGER – A salt of this size
STRING – Use this string as an octet-vector
VECTOR – Use this vector directly
See TO-OCTETS
Normalizes the KEY to an octet-vector using METHOD.
By default, method can be one of:
:HASH – Hash it by sha256
:FIT – Truncate or pad it out before turning into octets.
NIL – Just turn it into an octet-vector.
Convenience function to call the various encoders.
By default, THING can be one of:
NIL – Returns VECTOR
:OCTETS – See TO-OCTETS
:STRING – See TO-STRING
:HEX – See TO-HEX
:BASE64 – See TO-BASE64
:BASE32 – See TO-BASE32
Turns a vector into a base32-encoded string.
Turns a vector into a base64-encoded string.
Turn VECTOR into a hex-string.
Turns STRING into a FORMAT (default UTF-8) encoded octet-vector.
Turns OCTETS from FORMAT (default UTF-8) encoding into a string.
Jump to: | %
A B C D E F G H J K M N P R S T U W |
---|
Jump to: | %
A B C D E F G H J K M N P R S T U W |
---|
Jump to: | C D E F H P S T |
---|
Jump to: | C D E F H P S T |
---|