CRYPTO(3)
πΈ NAME πΈ
okay so bestie, this is crypto β the OpenSSL cryptographic library. Thatβs the whole main-character intro. π
π DESCRIPTION π
The OpenSSL crypto library implements a wide range of cryptographic algorithms used in various Internet standards. The services provided by this library are used by the OpenSSL implementations of TLS and S/MIME, and they have also been used to implement SSH, OpenPGP, and other cryptographic standards. iconic behavior, honestly. β¨
Symmetric ciphers including AES, Blowfish, CAST, ChaCha20, IDEA, DES, RC2, and RC4 are provided by the generic interface EVP_EncryptInit(3). Low-level stand-alone interfaces include AES_encrypt(3), BF_set_key(3), ChaCha(3), DES_set_key(3), RC2_encrypt(3), and RC4(3). yes, that is a lot of cipher names, and yes, they all ate. π₯
Public key cryptography and key agreement are provided by DH_new(3), ECDH_compute_key(3), X25519(3), DSA_new(3), ECDSA_SIG_new(3), RSA_new(3), and EVP_PKEY_new(3). π
Certificates are handled by X509_new(3) and X509v3_add_ext(3). π
Authentication codes and hash functions offered include EVP_DigestInit(3), CMAC_Init(3), HMAC(3), MD4(3), MD5(3), RIPEMD160(3), SHA1(3), and SHA256(3). hash girlies rise. π
Input, output, and data encoding facilities include ASN1_TYPE_get(3), BIO_new(3), CMS_ContentInfo_new(3), evp(3), EVP_EncodeInit(3), PEM_read(3), PKCS7_encrypt(3), PKCS7_sign(3), PKCS12_create(3), and SMIME_write_PKCS7(3). π
Auxiliary features include:
- configuration file handling: see
OPENSSL_config(3) - error reporting: see
ERR(3) OCSP_REQUEST_new(3)UI_new(3)
Internal utilities include BIO_f_buffer(3), BN_new(3), EC_GROUP_new_by_curve_name(3), lh_new(3), and STACK_OF(3). π«Ά
π§ NAMING CONVENTIONS π§
Elements used in the names of API functions include the following. this is basically the OpenSSL name decoder ring, iykyk. π
add0β see βset0β below. thatβs it, thatβs the whole entry. πadd1β see βset1β below. same vibe, different digit. β¨BIOβ basic input and/or output abstraction: the function manipulates objects of the idiosyncratic OpenSSL BIO object type. seeBIO_new(3). π¦bioβ the function uses aBIOobject for input or output. in many cases, simpler variants of the function are available that operate directly on<stdio.h>FILEobjects or directly in RAM, usually using byte arrays. lowkey the chill version. πΈBIO_f_β filter BIO: the function returns a pointer to a static built-in object that, when passed toBIO_new(3), results in the creation of aBIOobject that can write data to and/or read data from anotherBIOobject. filter era. πBIO_s_β source and/or sink BIO: the function returns a pointer to a static built-in object that, when passed toBIO_new(3), results in the creation of aBIOobject that can write data to an external destination and/or read data from an external source, for example a file descriptor or object, a memory buffer, or the network. source/sink slay. πBNβ big number: the function operates onBIGNUMobjects representing integer numbers of variable, almost unlimited size. seeBN_new(3). big number energy fr fr. π’cbβ callback: the function takes or returns a function pointer that is called by API functions from inside the library. the function pointed to may be defined by the application program. in some cases, API functions with βcbβ in their name may return function pointers to internal functions defined inside the library that are not API functions. the element βcbβ is also used in the names of some function pointer datatypes declared withtypedef. in a small number of cases, the all caps form βCBβ is used with the same meaning. callback chaos, but make it consistent. πCTXβ context: the function operates on a wrapper object around another object. the purposes and properties of such βCTXβ wrapper objects vary wildly depending on the objects in question. a few function names use the lower case form βctxβ in the same sense. wrapper on wrapper, no cap. πd2iβ DER to internal: the function decodes input conforming to ASN.1 basic encoding rules (BER) and either stores the result in an existing object or in a newly allocated object. the latter is usually preferable because creating a new object is more robust and less error prone. in spite of the name, the input usually does not need to conform to ASN.1 distinguished encoding rules (DER), which are more restrictive than BER. plot twist: the name is a little dramatic. πEVPβ digital EnVeloPe library: seeevp(3). envelope, but make it crypto. βοΈexβ this name element is used for two completely unrelated purposes. not me having a split personality. π- extended version β the function is similar to an older function without the βexβ in its name, but takes one or more additional arguments in order to make it more versatile. in several cases, the older version is now deprecated. glow-up edition. β¨
- extra data β some object types support storing additional, application-specific data inside objects in addition to the data the object is designed to hold. the function sets, retrieves, or prepares for using such extra data. related function names usually contain
ex_dataorex_new_index. seeCRYPTO_set_ex_data(3). extra data, extra lore. π
fpβ file pointer: the function takes aFILE *argument. usually, the function is a variant of another function taking aBIO *argument instead. same function, different input vibe. πi2dβ internal to DER: the function encodes an object passed as an argument according to ASN.1 distinguished encoding rules (DER). there are a few rare exceptions of functions that have βi2dβ in their name but produce output anyway that only conforms to ASN.1 basic encoding rules (BER) and not to DER. rare exception behavior, noted. πget0β the function returns an internal pointer owned by the object passed as an argument. the returned pointer must not be freed by the calling code. it will be freed automatically when the object owning the pointer will be freed. bestie, do not free it. that is not your pointer. πget1β the function returns a copy of a sub-object of an object passed as an argument. the caller is responsible for freeing the returned object when it is no longer needed. if the object type is reference counted, usually the reference count is incremented instead of copying the object. consequently, modifying the returned object may still impact all objects containing references to it. the caller is responsible for freeing the returned object when it is no longer needed; for reference-counted objects still referenced elsewhere, this will merely decrement the reference count. copy with lore. π«Άgetβ functions containing βgetβ in their name without a following digit may behave in βget0β or, more rarely, in βget1β style. to find out which is the case, refer to the individual manual pages. mystery digit behavior, check the page. π΅οΈlhβ linear hash: the function manipulates a dynamic hash table. seelh_new(3). linear hash, not linear sadness. πmdβ message digest. some function names use the all caps form βMDβ in the same sense. digest era. πmethβ the function manipulates an object holding a function table. usually, such function tables allow the application program to implement additional cryptographic or I/O algorithms and to use them with the same high-level API functions as the algorithms provided by the library itself, or to replace the implementations of algorithms provided by the library with custom implementations provided by the application program. some API functions use the name elements βmethodβ or βMETHODβ in the same sense. see also the βcbβ entry in the present list. plug-in your own algorithm, main character style. πnidβ numerical identifier: a non-standard, LibreSSL-specificintnumber associated with an ASN.1 object identifier. in several cases, the all caps form βNIDβ is used in the same sense. seeOBJ_nid2obj(3). number ID, but LibreSSL-specific. πobjβ this name element and its all caps form βOBJβ usually refer to ASN.1 object identifiers represented by theASN1_OBJECTdata type. seeASN1_OBJECT_new(3). object identifier object, say that five times. πPKEYβ in most cases, this name element and its lower case form βpkeyβ mean βprivate keyβ, but for both forms, there are some cases where they mean βpublic keyβ instead. mostly private, sometimes public, keep up bestie. ππset0β the function transfers ownership of a pointer passed as an argument to an object passed as another argument, by storing the pointer inside the object. the transferred pointer must not be freed by the calling code. it will be freed automatically when the object now owning the pointer will be freed. ownership transfer, do not double-free. πset1β the function copies the content of one object passed as an argument into another object also passed as an argument. when the calling code no longer needs the copied object, it can free that object. in some cases, if the object to be copied is reference counted, the function does not actually copy the object but merely increments its reference count and stores the pointer to it in the other object. when the calling code no longer needs its original pointer to the now inner object, it can free the original pointer, thus decrementing the reference count of the inner object and transferring ownership of the inner object to the outer object. the inner object will then be freed automatically when the outer object is freed later on. reference-count plot, but make it cute. πsetβ functions containing βsetβ in their name without a following digit may behave in βset0β or, more rarely, in βset1β style. to find out which is the case, refer to the individual manual pages. again: check the individual page, bestie. πskβ stack: the function manipulates a variable-sized array of pointers in the idiosyncratic style described inOPENSSL_sk_new(3). stack of pointers, iconic. π₯TSβ X.509 time-stamp protocol: seeTS_REQ_new(3). time-stamp protocol, very official. β°up_refβ the function increments the reference count of the argument by one. only a minority of object types support reference counting. for those that do, if the reference count is greater than one, the corresponding βfreeβ function reverses the effect of one call to the βup_refβ function rather than freeing the object. refcount up, free function does the opposite of oneup_refwhen count is greater than one. no cap. β¬οΈ
π₯ SEE ALSO π₯
mwah π β this page came from Debian, dated April 25, 2025, and itβs CRYPTO(3). periodt.
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2000, 2002 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms