crypto-for-kids
v0.2.1
Published
A crypto wrapper that a child could use
Readme
crypto-for-kids
Node's crypto wrapper a child could use
Hashing
crypto.md5sum(data, [encoding])
crypto.shasum(data, [encoding])
crypto.sha1sum(data, [encoding])
crypto.sha256sum(data, [encoding])
crypto.sha384sum(data, [encoding])
crypto.sha512sum(data, [encoding])
dataor {String} with data to hash- encoding {String} output encoding (default: 'hex')
Returns a string with the hash of data using the corresponding algorithm (md5, sha, sha1, sha256, sha384, sha512sum)
Signing
crypto.hs256(data, secret, [encoding])
crypto.hs384(data, secret, [encoding])
crypto.hs512(data, secret, [encoding])
crypto.rs256(data, privateKey, [encoding])
crypto.rs384(data, privateKey, [encoding])
crypto.rs512(data, privateKey, [encoding])
dataor {String} with data to hashsecretor {String} with secret to useprivateKeyor {String} or {Object} with private key to useencoding{String} output encoding (default: 'hex')
Returns a signature for the data using either hmac or rsa signing
For rsXXX functions key can be an Object with passprhrase like in node's crypto module
