Thursday, September 25, 2025
HomeLanguagesPHP openssl_get_md_methods() Function

PHP openssl_get_md_methods() Function

The openssl_get_md_methods() function is an inbuilt function in PHP that is used to retrieve a list of available digest (message digest) methods supported by OpenSSL.

Syntax:

openssl_get_md_methods(bool $aliases = false): array

Parameters: This function accepts one parameter which is described below.

  • $aliases: If $aliases are true, any aliases for the digest methods will be included in the array. 

Return Values: This function returns an array of strings representing the available digest methods supported by OpenSSL. If no digest methods are available, it will return “false”.

Example 1: The following program demonstrates the openssl_get_md_methods() function.

PHP




<?php
$digest_methods = openssl_get_md_methods();
  
if ($digest_methods !== false) {
    echo "Available digest methods:\n";
    foreach ($digest_methods as $method) {
        echo "- $method\n";
    }
} else {
    echo "No digest methods available.";
}
?>


Output:

Available digest methods:
- blake2b512
- blake2s256
- md4
- md5
- md5-sha1
- ripemd160
- sha1
- sha224
- sha256
- sha3-224
- sha3-256
- sha3-384
- sha3-512
- sha384
- sha512
- sha512-224
- sha512-256
- shake128
- shake256
- sm3
- whirlpool
 

Example 2: The following program demonstrates the openssl_get_md_methods()  function.

PHP




<?php
$digest_methods = openssl_get_md_methods();
  
if ($digest_methods !== false) {
    echo "Available digest methods: ";
    echo implode(", ", $digest_methods);
} else {
    echo "No digest methods available.";
}
?>


Output:

Available digest methods: blake2b512, blake2s256, md4, md5, md5-sha1,
 ripemd160, sha1, sha224, sha256, sha3-224, sha3-256, sha3-384, 
 sha3-512, sha384, sha512, sha512-224, sha512-256, shake128, shake256, sm3, whirlpool  

Reference: https://www.php.net/manual/en/function.openssl-get-md-methods.php

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32319 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6682 POSTS0 COMMENTS
Nicole Veronica
11854 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11910 POSTS0 COMMENTS
Shaida Kate Naidoo
6795 POSTS0 COMMENTS
Ted Musemwa
7071 POSTS0 COMMENTS
Thapelo Manthata
6754 POSTS0 COMMENTS
Umr Jansen
6761 POSTS0 COMMENTS