MCRYPT_MODULE_SELF_TEST(3) 1 MCRYPT_MODULE_SELF_TEST(3)mcrypt_module_self_test - This function runs a self test on the specified moduleSYNOPSIS
bool mcrypt_module_self_test (string $algorithm, [string $lib_dir])
DESCRIPTION
This function runs the self test on the algorithm specified.
PARAMETERS
o $algorithm
-One of the MCRYPT_ciphername constants, or the name of the algorithm as string.
o $lib_dir
- The optional $lib_dir parameter can contain the location where the algorithm module is on the system.
RETURN VALUES
The function returns TRUE if the self test succeeds, or FALSE when it fails.
EXAMPLES
Example #1
mcrypt_module_self_test(3) example
<?php
var_dump(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)) . "
";
var_dump(mcrypt_module_self_test(MCRYPT_BOGUS_CYPHER));
?>
The above example will output:
bool(true)
bool(false)
PHP Documentation Group MCRYPT_MODULE_SELF_TEST(3)
Check Out this Related Man Page
OPENSSL_RANDOM_PSEUDO_BYTES(3) 1 OPENSSL_RANDOM_PSEUDO_BYTES(3)openssl_random_pseudo_bytes - Generate a pseudo-random string of bytesSYNOPSIS
string openssl_random_pseudo_bytes (int $length, [bool &$crypto_strong])
DESCRIPTION
Generates a string of pseudo-random bytes, with the number of bytes determined by the $length parameter.
It also indicates if a cryptographically strong algorithm was used to produce the pseudo-random bytes, and does this via the optional
$crypto_strong parameter. It's rare for this to be FALSE, but some systems may be broken or old.
PARAMETERS
o $length
- The length of the desired string of bytes. Must be a positive integer. PHP will try to cast this parameter to a non-null integer
to use it.
o $crypto_strong
- If passed into the function, this will hold a boolean value that determines if the algorithm used was "cryptographically
strong", e.g., safe for usage with GPG, passwords, etc. TRUE if it did, otherwise FALSE
RETURN VALUES
Returns the generated string of bytes on success, or FALSE on failure.
EXAMPLES
Example #1
openssl_random_pseudo_bytes(3) example
<?php
for ($i = -1; $i <= 4; $i++) {
$bytes = openssl_random_pseudo_bytes($i, $cstrong);
$hex = bin2hex($bytes);
echo "Lengths: Bytes: $i and Hex: " . strlen($hex) . PHP_EOL;
var_dump($hex);
var_dump($cstrong);
echo PHP_EOL;
}
?>
The above example will output something similar to:
Lengths: Bytes: -1 and Hex: 0
string(0) ""
NULL
Lengths: Bytes: 0 and Hex: 0
string(0) ""
NULL
Lengths: Bytes: 1 and Hex: 2
string(2) "42"
bool(true)
Lengths: Bytes: 2 and Hex: 4
string(4) "dc6e"
bool(true)
Lengths: Bytes: 3 and Hex: 6
string(6) "288591"
bool(true)
Lengths: Bytes: 4 and Hex: 8
string(8) "ab86d144"
bool(true)
SEE ALSO random_bytes(3), bin2hex(3), crypt(3), mt_rand(3), uniqid(3).
PHP Documentation Group OPENSSL_RANDOM_PSEUDO_BYTES(3)
Emergency UNIX and Linux Support !! Help Me! Forum (Request Urgent Help)
README FIRST: How to Request Emergency or Urgent Help:
You may post emergency work-related questions in the emergency forum. To post in this forum you will need to use your Bits. All questions answered on a "best... (0 Replies)
Homework Help:
On Posting Questions:
Any and all high school and undergraduate homework assignments or textbook style exercises for which you are seeking assistance are to be posted only in our Homework & Coursework Questions area--not in blogs, visitor messages, PMs, or the main technical... (0 Replies)
How to Use Code Tags in The UNIX and Linux Forums
Developer: This video tutorial was created by scott for forum users. Everyone should use code tags when posting code and command line logic in the forums.
cPF45jjWe7Q
A full list of BB codes is available here. (8 Replies)
RULES OF THE UNIX AND LINUX FORUMS
For the latest version of the community rules (the official community rules page), please visit here.
No flames, shouting (all caps), sarcasm, bullying, profanity or arrogant posts.
No negative comments about others or impolite remarks. Be patient. No... (1 Reply)
Hey,
Just added a new UserCP option so you can change the code tags to look like the code tags in this example (turn this on and off):
Note: I set the default to "SyntaxHighlighting" for debugging purposes. We can change the default back to the original code tags later.
... (36 Replies)
Having spent a lot of time over the past year taking a legacy vBulletin site (this forum) and making the site responsive on mobile; I've happy with the results; but it will soon be time to move on.
Basically, at our core, we are a LAMP (Linux, Apache2, MySQL and PHP) site, and vBulletin was... (6 Replies)
On this special Happy News Year day, 1 January 2019, I am pleased to promote Ravinder Singh to UNIX.COM Moderator, for at least the following reasons:
Ravinder Loves UNIX.COM
Ravinder has 1,372 Thanks, which puts him in the Top Ten in that important single category.
Ravinder is one of... (8 Replies)
Please join me in congratulations to Wolf Machowitsch (bakunin) for his long overdue lifetime achievement award badge from UNIX.COM in computer wizardry:
"The Order of the Wizard's Hat - Lifetime Achievement Award"
This "Order of the Wizard's Hat" is presented to Wolf Machowitsch (bakunin)... (11 Replies)
Dear All,
We were hit with a denial of service (DOS) attack today beginning around June 12th 2019 @ 01:27:51 PM from an IP address registered to "RACKWEB-NET" in Bulgaria.
I was notified about this around June 12th 2019 @ 03:05 PM and did some log file analysis and discovered how the attack... (4 Replies)
Dear All,
I am very pleased to inform everyone that Nicki Paul (zxmaus) is joining the Moderation Team after a number of years away from the site.
Nicki used to be very active here (over 800 posts), and she got busy with travel, work, family and her dogs, and we have missed her. Now she is... (7 Replies)