Introduction
Signing data with the crypto API: The crypto API provides a simple interface for working with public/private key encryption.
The methods provided expose the functionality from the industry standard openssl library.
Note: This API is very helpful when implementing things like OAuth 1 and 2.
Using the crypto API [top]
- First we need to identify the supported algorithms:
- crypto.algorithms: returns a Lua array table containing the list of supported algorithms.
- Then the other routines then take the name of the algorithm being used as one of the parameters:
- crypto.digest: Computes the binary checksum of the input data using the specified hashing algorithm.
- crypto.hmac: Generates a Keyed-Hash Message Authentication code (HMAC) based on input data and a shared secret key.
- crypto.sign: Used to sign documents with either RSA or DSA private keys.
- crypto.verify: Used to verify the validity of an RSA or DSA signature.
How crypto works [top]
The methods provided simply expose the functionality from the industry standard openssl library.
More Information [top]
- See the crypto API reference
- To encrypt and decrypt data using AES encryption see: