Tag

mcrypt

1 views collected around this technical thread.

Laravel Tech Community
Laravel Tech Community
Jun 21, 2022 · Information Security

Using PHP mcrypt for Symmetric Encryption: DES and AES Code Examples

This article explains symmetric encryption concepts, lists common algorithms, and demonstrates how to use PHP's mcrypt extension to perform DES and AES encryption and decryption in various modes with complete code examples.

AESDESPHP
0 likes · 7 min read
Using PHP mcrypt for Symmetric Encryption: DES and AES Code Examples
Laravel Tech Community
Laravel Tech Community
Jun 3, 2021 · Backend Development

Using mdecrypt_generic() to Decrypt Data in PHP

This article explains the PHP mdecrypt_generic() function, its parameters, and provides a complete example that demonstrates opening an encryption module, encrypting data, decrypting it back, and verifying the result while handling necessary initialization and cleanup steps.

EncryptionExamplePHP
0 likes · 2 min read
Using mdecrypt_generic() to Decrypt Data in PHP
Laravel Tech Community
Laravel Tech Community
Jun 2, 2021 · Information Security

mcrypt_module_open – Opening Encryption Algorithm and Mode Modules in PHP

The article explains the PHP function mcrypt_module_open, detailing its purpose of opening encryption algorithm and mode modules, describing each of its four parameters, default directory behaviors, and the return value indicating success with a resource or failure with FALSE.

EncryptionPHPbackend
0 likes · 2 min read
mcrypt_module_open – Opening Encryption Algorithm and Mode Modules in PHP
Laravel Tech Community
Laravel Tech Community
Jun 1, 2021 · Backend Development

mcrypt_module_close() – Close Encryption Module (PHP)

The PHP function mcrypt_module_close() releases an opened encryption module by taking a resource descriptor as its argument and returns TRUE on success or FALSE on failure, providing a simple way to clean up cryptographic resources in backend applications.

EncryptionPHPbackend
0 likes · 1 min read
mcrypt_module_close() – Close Encryption Module (PHP)
Laravel Tech Community
Laravel Tech Community
May 30, 2021 · Information Security

Using mcrypt_get_key_size() to Retrieve the Key Size of a Specified Cipher in PHP

The article explains the PHP mcrypt_get_key_size() function, its prototypes for different libmcrypt versions, the meaning of its cipher and mode parameters, the return value indicating maximum key size, and provides a practical code example demonstrating its usage.

Encryptionbackendkey size
0 likes · 2 min read
Using mcrypt_get_key_size() to Retrieve the Key Size of a Specified Cipher in PHP
Laravel Tech Community
Laravel Tech Community
May 28, 2021 · Backend Development

PHP mcrypt_generic() Function for Data Encryption

The article explains PHP's mcrypt_generic() function, detailing its purpose for encrypting data, required parameters ($td as the encryption descriptor and $data as the plaintext), the need for block-size-aligned input, initialization and cleanup steps, and the nature of its returned encrypted output.

Encryptionbackendmcrypt
0 likes · 2 min read
PHP mcrypt_generic() Function for Data Encryption
Laravel Tech Community
Laravel Tech Community
May 27, 2021 · Backend Development

PHP mcrypt_encrypt Function: Parameters, Usage, and Return Value

mcrypt_encrypt encrypts plaintext using a specified cipher, key, mode, and optional IV, returning the ciphertext as a string or FALSE on failure, with detailed explanations of each parameter—including cipher name, key length requirements, data padding, mode options, and IV usage—provided for PHP developers.

Encryptionmcryptsecurity
0 likes · 2 min read
PHP mcrypt_encrypt Function: Parameters, Usage, and Return Value
Laravel Tech Community
Laravel Tech Community
May 26, 2021 · Information Security

mcrypt_enc_get_key_size – Returns the Maximum Supported Key Size for an Opened Encryption Mode

The PHP function mcrypt_enc_get_key_size returns the maximum key length, in bytes, that the currently opened encryption mode can support, taking a resource descriptor as its sole parameter and providing developers with essential information for handling encryption keys securely.

EncryptionPHPinformation security
0 likes · 1 min read
mcrypt_enc_get_key_size – Returns the Maximum Supported Key Size for an Opened Encryption Mode
Laravel Tech Community
Laravel Tech Community
May 25, 2021 · Information Security

mcrypt_enc_get_block_size – Returns the Block Size of the Opened Encryption Algorithm

The mcrypt_enc_get_block_size function in PHP returns the block size, in bytes, of the encryption algorithm associated with a given encryption descriptor resource, providing essential information for handling block cipher operations and ensuring correct data padding during encryption and decryption processes.

EncryptionPHPbackend
0 likes · 1 min read
mcrypt_enc_get_block_size – Returns the Block Size of the Opened Encryption Algorithm
Laravel Tech Community
Laravel Tech Community
May 24, 2021 · Information Security

mcrypt_enc_get_algorithms_name() Returns the Name of the Opened Encryption Algorithm

The PHP function mcrypt_enc_get_algorithms_name($td) returns the name of the encryption algorithm associated with the given encryption descriptor, providing developers with a string that identifies the algorithm currently in use for cryptographic operations.

EncryptionPHPfunction
0 likes · 1 min read
mcrypt_enc_get_algorithms_name() Returns the Name of the Opened Encryption Algorithm
Laravel Tech Community
Laravel Tech Community
May 23, 2021 · Information Security

PHP mcrypt_decrypt() – Decrypt Ciphertext with Given Parameters

The PHP mcrypt_decrypt() function decrypts data using a specified cipher, key, mode, and optional initialization vector, returning the plaintext string or FALSE on failure, with detailed parameter descriptions and usage notes.

EncryptionPHPbackend
0 likes · 2 min read
PHP mcrypt_decrypt() – Decrypt Ciphertext with Given Parameters
Laravel Tech Community
Laravel Tech Community
May 22, 2021 · Backend Development

mcrypt_create_iv() – Creating an Initialization Vector from a Random Source

The article explains how the PHP function mcrypt_create_iv() generates an initialization vector of a given size using various random sources, describes its parameters, default behavior, platform considerations, and return values, emphasizing that the IV need not be kept secret.

backendcryptographyinitialization vector
0 likes · 2 min read
mcrypt_create_iv() – Creating an Initialization Vector from a Random Source
Laravel Tech Community
Laravel Tech Community
May 21, 2021 · Backend Development

mcrypt_cfb() – Encrypting and Decrypting Data Using CFB Mode in PHP

This article explains the PHP mcrypt_cfb() function, detailing its signature, parameters—including cipher, key, data, mode, and IV—its compatibility with different libmcrypt versions, and the permissible mode constants for encrypting or decrypting data in CFB mode.

CFB modeEncryptionbackend
0 likes · 1 min read
mcrypt_cfb() – Encrypting and Decrypting Data Using CFB Mode in PHP
Laravel Tech Community
Laravel Tech Community
May 20, 2021 · Information Security

mcrypt_cbc() Function for CBC‑Mode Encryption and Decryption in PHP

This article explains the PHP mcrypt_cbc() function, detailing its two prototypes for different libmcrypt versions, the full parameter list—including optional IV—and the mode constants MCRYPT_ENCRYPT and MCRYPT_DECRYPT used for CBC‑mode cryptographic operations.

CBCEncryptionPHP
0 likes · 1 min read
mcrypt_cbc() Function for CBC‑Mode Encryption and Decryption in PHP