php8.5
Home/ Manual/ mcrypt / functions/ mcrypt_get_cipher_name

mcrypt_get_cipher_name

PHP function Edit on GitHub ✎

(PHP 4, PHP 5, PHP 7 < 7.2.0, PECL mcrypt >= 1.0.0)

Gets the name of the specified cipher

Removed-7-2-0

Description

mcrypt_get_cipher_name(int $cipher): string
mcrypt_get_cipher_name(string $cipher): string

mcrypt_get_cipher_name() is used to get the name of the specified cipher.

mcrypt_get_cipher_name() takes the cipher number as an argument (libmcrypt 2.2.x) or takes the cipher name as an argument (libmcrypt 2.4.x or higher) and returns the name of the cipher or false, if the cipher does not exist.

Parameters

cipher

Cipher

Return Values

This function returns the name of the cipher or false if the cipher does not exist.

Examples

mcrypt_get_cipher_name() Example

php
<?php
   $cipher = MCRYPT_TripleDES;

   echo mcrypt_get_cipher_name($cipher);
?>

The above example will output:

output
3DES

Source: reference/mcrypt/functions/mcrypt-get-cipher-name.xml · from the official PHP manual (php/doc-en)