/usr/lib/swipl/library/ext/ssl/crypto.pl
All Application Manual Name SummaryHelp

  • ext
    • ssl
      • ssl.pl -- Secure Socket Layer (SSL) library
      • crypto.pl -- Cryptography and authentication library
        • crypto_n_random_bytes/2
        • crypto_data_hash/3
        • crypto_file_hash/3
        • crypto_context_new/2
        • crypto_data_context/3
        • crypto_context_hash/2
        • crypto_open_hash_stream/3
        • crypto_stream_hash/2
        • crypto_password_hash/2
        • crypto_password_hash/3
        • crypto_data_hkdf/4
        • ecdsa_sign/4
        • ecdsa_verify/4
        • hex_bytes/2
        • rsa_private_decrypt/4
        • rsa_private_encrypt/4
        • rsa_public_decrypt/4
        • rsa_public_encrypt/4
        • rsa_sign/4
        • rsa_verify/4
        • crypto_data_decrypt/6
        • crypto_data_encrypt/6
        • crypto_modular_inverse/3
        • crypto_generate_prime/3
        • crypto_is_prime/2
        • crypto_name_curve/2
        • crypto_curve_order/2
        • crypto_curve_generator/2
        • crypto_curve_scalar_mult/4
      • xmlenc.pl -- XML encryption library
      • xmldsig.pl -- XML Digital signature
 crypto_data_decrypt(+CipherText, +Algorithm, +Key, +IV, -PlainText, +Options)
Decrypt the given CipherText, using the symmetric algorithm Algorithm, key Key, and initialization vector IV, to give PlainText. CipherText must be a string, atom or list of codes or characters, and PlainText is created as a string. Key and IV are typically lists of bytes, though atoms and strings are also permitted. Algorithm must be an algorithm which your copy of OpenSSL knows. See crypto_data_encrypt/6 for an example.
encoding(+Encoding)
Encoding to use for CipherText. Default is utf8. Alternatives are utf8 and octet.
padding(+PaddingScheme)
For block ciphers, the padding scheme to use. Default is block. You can disable padding by supplying none here.
tag(+Tag)
For authenticated encryption schemes, the tag must be specified as a list of bytes exactly as they were generated upon encryption. This option requires OpenSSL 1.1.0 or greater.
min_tag_length(+Length)
If the tag length is smaller than 16, this option must be used to permit such shorter tags. This is used as a safeguard against truncation attacks, where an attacker provides a short tag that is easier to guess.