dm_crypto Module

Cryptographic hash functions from OpenSSL:

  • MD4
  • MD5
  • RIPEMD-160
  • SHA-1
  • SHA-224
  • SHA-256
  • SHA-384
  • SHA-512

The functions return hexadecimal character strings in lower-case format. Link this module against -lcrypto.


Uses

  • module~~dm_crypto~~UsesGraph module~dm_crypto dm_crypto iso_c_binding iso_c_binding module~dm_crypto->iso_c_binding module~dm_c dm_c module~dm_crypto->module~dm_c module~dm_string dm_string module~dm_crypto->module~dm_string module~dm_c->iso_c_binding module~dm_kind dm_kind module~dm_c->module~dm_kind module~dm_error dm_error module~dm_string->module~dm_error module~dm_string->module~dm_kind module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env

Used by

  • module~~dm_crypto~~UsedByGraph module~dm_crypto dm_crypto module~dmpack dmpack module~dmpack->module~dm_crypto

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: CRYPTO_HASH_TYPE_NONE = 0

Invalid.

integer, public, parameter :: CRYPTO_HASH_TYPE_MD4 = 1

MD4.

integer, public, parameter :: CRYPTO_HASH_TYPE_MD5 = 2

MD5.

integer, public, parameter :: CRYPTO_HASH_TYPE_RIPEMD160 = 3

RIPEMD-160.

integer, public, parameter :: CRYPTO_HASH_TYPE_SHA1 = 4

SHA-1.

integer, public, parameter :: CRYPTO_HASH_TYPE_SHA224 = 5

SHA-224.

integer, public, parameter :: CRYPTO_HASH_TYPE_SHA256 = 6

SHA-256.

integer, public, parameter :: CRYPTO_HASH_TYPE_SHA384 = 7

SHA-384.

integer, public, parameter :: CRYPTO_HASH_TYPE_SHA512 = 8

SHA-512.

integer, public, parameter :: CRYPTO_HASH_TYPE_LAST = 8

Never use this.

integer, public, parameter :: CRYPTO_MD4_DIGEST_LEN = 16
integer, public, parameter :: CRYPTO_MD5_DIGEST_LEN = 16
integer, public, parameter :: CRYPTO_RIPEMD160_DIGEST_LEN = 20
integer, public, parameter :: CRYPTO_SHA1_DIGEST_LEN = 20
integer, public, parameter :: CRYPTO_SHA224_DIGEST_LEN = 28
integer, public, parameter :: CRYPTO_SHA256_DIGEST_LEN = 32
integer, public, parameter :: CRYPTO_SHA384_DIGEST_LEN = 48
integer, public, parameter :: CRYPTO_SHA512_DIGEST_LEN = 64
integer, public, parameter :: CRYPTO_MD4_HASH_LEN = 2*CRYPTO_MD4_DIGEST_LEN
integer, public, parameter :: CRYPTO_MD5_HASH_LEN = 2*CRYPTO_MD5_DIGEST_LEN
integer, public, parameter :: CRYPTO_RIPEMD160_HASH_LEN = 2*CRYPTO_RIPEMD160_DIGEST_LEN
integer, public, parameter :: CRYPTO_SHA1_HASH_LEN = 2*CRYPTO_SHA1_DIGEST_LEN
integer, public, parameter :: CRYPTO_SHA224_HASH_LEN = 2*CRYPTO_SHA224_DIGEST_LEN
integer, public, parameter :: CRYPTO_SHA256_HASH_LEN = 2*CRYPTO_SHA256_DIGEST_LEN
integer, public, parameter :: CRYPTO_SHA384_HASH_LEN = 2*CRYPTO_SHA384_DIGEST_LEN
integer, public, parameter :: CRYPTO_SHA512_HASH_LEN = 2*CRYPTO_SHA512_DIGEST_LEN

Functions

public function dm_crypto_md4(str) result(hash)

MD4 cryptographic hash function with a 128 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_MD4_HASH_LEN)

Output hash.

public function dm_crypto_md5(str) result(hash)

MD5 cryptographic hash function with a 128 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_MD5_HASH_LEN)

Output hash.

public function dm_crypto_ripemd160(str) result(hash)

RIPEMD-160 cryptographic hash function with a 160 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_RIPEMD160_HASH_LEN)

Output hash.

public function dm_crypto_sha1(str) result(hash)

SHA-1 cryptographic hash function with a 160 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_SHA1_HASH_LEN)

Output hash.

public function dm_crypto_sha224(str) result(hash)

SHA-2 cryptographic hash function with a 224 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_SHA224_HASH_LEN)

Output hash.

public function dm_crypto_sha256(str) result(hash)

SHA-2 cryptographic hash function with a 256 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_SHA256_HASH_LEN)

Output hash.

public function dm_crypto_sha384(str) result(hash)

SHA-2 cryptographic hash function with a 384 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_SHA384_HASH_LEN)

Output hash.

public function dm_crypto_sha512(str) result(hash)

SHA-2 cryptographic hash function with a 512 bit output.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

Return Value character(len=CRYPTO_SHA512_HASH_LEN)

Output hash.