1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-06 06:29:03 +00:00
Files
nmap/nselib/openssl.luadoc
david a2ca60092c Remove module and object prefixes from function names in .luadoc files, as
suggested by jah in http://seclists.org/nmap-dev/2008/q4/0232.html. This makes
@see cross-references to functions in these files work from other modules.
2008-10-24 15:57:11 +00:00

124 lines
4.0 KiB
Plaintext

--- OpenSSL bindings.
-- \n\n
-- This module is a wrapper for OpenSSL functions that provide encryption and
-- decryption, hashing, and multiprecision integers.
-- \n\n
-- The openssl module may not always be available--it depends on whether
-- OpenSSL support was enabled at compile time. Scripts using the module should
-- be made to fail gracefully using code like the following:
-- \n\n
-- <code>
-- if not pcall(require, "openssl") then\n
-- action = function(host, port)\n
-- stdnse.print_debug(2, "Skipping \"%s\" because OpenSSL is missing.", id)\n
-- end\n
-- end\n
-- action = action or function(host, port)\n
-- ...\n
-- end
-- </code>
-- @author Sven Klemm <sven@c3d2.de>
-- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html
module "openssl"
--- Returns the size of bignum in bits.
function bignum_num_bits(bignum)
--- Returns the size of bignum in bytes.
function bignum_num_bytes(bignum)
--- Sets the bit at position in bignum.
function bignum_set_bit(bignum, position)
--- Clears the bit at position in bignum.
function bignum_clear_bit(bignum, position)
--- Gets the state of the bit at position in bignum.
function bignum_is_bit_set(bignum, position)
--- Sets the sign of bignum. If negative is true the sign becomes negative,
-- otherwise it becomes positive.
function bignum_set_negative(bignum, negative)
--- Returns true if bignum is negative, false otherwise.
function bignum_is_negative(bignum)
--- Converts the binary-encoded string into a bignum.
function bignum_bin2bn(string)
--- Converts the decimal-encoded string into a bignum.
function bignum_dec2bn(string)
--- Converts the hex-encoded string into a bignum.
function bignum_hex2bn(string)
--- Converts bignum into a binary-encoded string.
function bignum_bn2bin(bignum)
--- Converts bignum into a decimal-encoded string.
function bignum_bn2dec(bignum)
--- Converts bignum into a hex-encoded string.
function bignum_bn2hex(bignum)
--- Returns a random bignum with a
function bignum_rand(bits)
--- Returns a pseudorandom bignum with a the given size in bits.
function bignum_pseudo_rand(bits)
--- Returns the bignum which is the result of a^p mod m.
function bignum_mod_exp(a, p, m)
--- Returns a string of length bytes containing random data.
function rand_bytes(bytes)
--- Returns a string of length bytes containing pseudorandom data.
function rand_pseudo_bytes(bytes)
--- Returns the MD2 digest of message.
function md2(message)
--- Returns the MD4 digest of message.
function md4(message)
--- Returns the MD5 digest of message.
function md5(message)
--- Returns the SHA-1 digest of message.
function sha1(message)
--- Returns the RIPEMD-160 digest of message.
function ripemd160(message)
--- Returns the digest of message using the algorithm given by the string
-- algorithm. The algorithm name may be anything returned by the
-- openssl.supported_digests function.
function digest(algorithm, message)
--- Returns the message authentication code of message using the given algorithm
-- and key. algorithm may be anything returned by the openssl.supported_digests
-- function.
function hmac(algorithm, key, message)
--- Encrypt data with the given algorithm, key, and initialization vector.
-- algorithm may be anything returned by the openssl.supported_ciphers function.
-- If padding is true then a partial final block will be padded and encrypted.
function encrypt(algorithm, key, iv, data, padding = false)
--- Encrypt data with the given algorithm, key, and initialization vector.
-- algorithm may be anything returned by the openssl.supported_ciphers function.
-- If padding is true then the final block must be padded correctly.
function decrypt(algorithm, key, iv, data, padding = false)
--- Returns a table with the names of the supported cipher algorithms.
function supported_ciphers()
--- Returns a table with the names of the supported digest algorithms.
function supported_digests()
--- Converts data, which must be a 7-byte string, into an 8-byte DES key and
-- sets the parity.
function DES_string_to_key(string data)