Libgcrypt

{{Short description|Cryptographic software library}}

{{DISPLAYTITLE:Libgcrypt}}

{{Infobox software

| name = Libgcrypt

| logo =

| screenshot =

| caption =

| ver layout = stacked

| developer = GnuPG community{{cite web|url=https://dev.gnupg.org/source/libgcrypt/browse/master/AUTHORS|title=AUTHORS|access-date=2021-02-09}}

| author = Werner Koch

| programming language = C

| operating system = Cross-platform

| genre = Cryptographic library

| license = GNU Lesser General Public License (LGPLv2.1+) / GNU General Public License (GPLv2+){{cite web

| url=https://gnupg.org/software/libgcrypt/index.html#sec-1-2

| title=Copying

| work=Libgcrypt

| date=2021-02-04

| accessdate=2021-02-09}}

| website = {{URL|https://gnupg.org/software/libgcrypt/}}

}}

Libgcrypt is a cryptography library developed as a separated module of GnuPG.{{cite mailing list

| last=Koch

| first=Werner

| url=https://lists.gnupg.org/pipermail/gnupg-devel/1998-December/015041.html

| title=libgcrypt

| publisher=gnupg-devel

| date=1998-12-04

| accessdate=2017-08-30}}

It can also be used independently of GnuPG, but depends on its error-reporting library Libgpg-error.{{cite web

| url=https://gnupg.org/software/libgpg-error/index.html

| title=Libgpg-error

| work=GnuPG software

| date=2017-03-22

| accessdate=2017-12-13}}

It provides functions for all fundamental cryptographic building blocks:

class="wikitable" border="1"

!Primitive or Operation !! Algorithms or Implementation{{cite web

| url=https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob;f=src/cipher.h;hb=HEAD

| title=src/cipher.h

| date=2017-06-16

| accessdate=2017-08-30}}

symmetric ciphers:{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Available-ciphers.html

| title=Available ciphers

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}

| AES (128, 192, 256 bits), DES, 3DES, IDEA, CAST5, Blowfish, Twofish (128, 256 bits), Ron's Cipher 2 / RC2 (40, 128 bits), ARCfour / RC4, SEED ({{IETF RFC|4269|link=no}}), Serpent (128, 192, 256 bits), Camellia (128, 192, 256 bits), Salsa20, Salsa20/12, ChaCha20, GOST 28147-89 ({{IETF RFC|5830|link=no}}) / GOST R 34.12-2015 (Magma: {{IETF RFC|8891|link=no}} & Kuznyechik: {{IETF RFC|7801|link=no}}), SM4, ARIA

cipher modes:{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Available-cipher-modes.html

| title=Available cipher modes

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}

| ECB, CFB, CBC, OFB, CTR, CCM, GCM, OCB, EAX, XTS, Stream, AES Key Wrap ({{IETF RFC|3394|link=no}}), AES Key Wrap with padding ({{IETF RFC|5649|link=no}}), SIV ({{IETF RFC|5297|link=no}}) and GCM-SIV ({{IETF RFC|8452|link=no}})

public key algorithms:{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Available-algorithms.html

| title=Available algorithms

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Cryptographic-Functions.html

| title=Cryptographic Functions

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}

| RSA, ElGamal, DSA, ECDSA, EdDSA, Ed448, DH, EDH, ECDH

hash algorithms:{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Available-hash-algorithms.html

| title=Available hash algorithms

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}

| MD2, MD4, MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, SHAKE256, RIPEMD-160, TIGER/192, TIGER1, TIGER2, Whirlpool, CRC-24 (as in {{IETF RFC|2440|link=no}}), CRC-32 (as in ISO 3309), CRC-32 (as in {{IETF RFC|1510|link=no}}), GOST R 34.11-94 / GOST 34.311-95, GOST R 34.11-2012 (Stribog) / {{IETF RFC|6986|link=no}}, BLAKE2b (128, 160, 224, 256 Bits), BLAKE2s (160, 256, 384, 512 Bits), SM3{{cite web|url=https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3 |title=The SM3 Cryptographic Hash Function |publisher=Internet Engineering Task Force |date=2018-01-08 |accessdate=2023-11-16 |last1=Shen |first1=Sean |last2=Lee |first2=Xiaodong |last3=Tse |first3=Ronald Henry |last4=Kit |first4=Wong Wai |last5=Yang |first5=Paul }}

message authentication codes (MACs):{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Available-MAC-algorithms.html

| title=Available MAC algorithms

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}

| HMAC for all hash algorithms, CMAC for all cipher algorithms, GMAC for some cipher algorithms, Poly1305

key derivation functions (KDFs):{{cite web

| url=https://www.gnupg.org/documentation/manuals/gcrypt/Key-Derivation.html

| title=Key Derivation

| work=The Libgcrypt Reference Manual

| date=2017-08-27

| accessdate=2017-08-30}}

| S2K (as in {{IETF RFC|4880|link=no}}: simple, salted, iterated+salted), PBKDF2, SCRYPT, Argon2d, Argon2i, Argon2id, Balloon

elliptic curves:

| NIST (P-256, P-384, P-521), SECG (secp256k1), ECC Brainpool / {{IETF RFC|5639|link=no}} (P256r1, P384r1, P512r1), Bernstein (Curve25519, Curve448), GOST R 34.10-2012 ({{IETF RFC|7091|link=no}}), SM2{{cite web|url=https://datatracker.ietf.org/doc/html/draft-shen-sm2-ecdsa |title=SM2 Digital Signature Algorithm |publisher=Internet Engineering Task Force |date=2014-02-14 |accessdate=2023-11-16 |last1=Shen |first1=Sean |last2=Lee |first2=Xiaodong }}

Libgcrypt features its own multiple precision arithmetic implementation, with assembler implementations for a variety of processors, including Alpha, AMD64, HP PA-RISC, i386, i586, M68K, MIPS 3, PowerPC, and SPARC. It also features an entropy gathering utility, coming in different versions for Unix-like and Windows machines.

Usually multiple, stable branches of Libgcrypt are maintained in parallel; since 2022-03-28 this is the Libgrypt 1.10 branch as stable branch, plus the 1.8 branch as LTS ("long-term support") branch, which will be maintained at least until 2024-12-31.{{cite web

| url=https://gnupg.org/download/#end-of-life

| title=End-of-life dates for GnuPG and Libgcrypt

| work=GnuPG software

| date=2021-02-04

| accessdate=2021-02-07}}

See also

{{Portal|Free and open-source software}}

References