mcrypt

Upgrading my encryption library from Mcrypt to OpenSSL

余生颓废 提交于 2019-11-26 03:19:01
问题 I am using the below commonly referenced library for encryption. I want to upgrade it to OpenSSL from Mcrypt so that I am no longer using a deprecated library. I\'m trying to find out if this is even possible. I\'ve done some research on this, but I\'ve found conflicting information: This post says that it is impossible to decrypt data using OpenSSL that was encrypted with Mcrypt. https://stackoverflow.com/a/19748494/5834657 However, this post says that it is possible using padding. It

Replace Mcrypt with OpenSSL

别等时光非礼了梦想. 提交于 2019-11-26 01:47:35
问题 currently we have a mcrypt implentation on our systems to crypt some sensible data in our PHP application. Now we have a new requirement that we have to change the crypt module to openssl. Another thing which is important know is that we are using the cipher blowfish and the mode ecb. So I began to test what are differences and how I can decrypt mcrypt encrypted strings with openssl. I used the standard PHP function: mcrypt_encrypt vs. openssl_encrypt mcrypt_decrypt vs. openssl_decrypt Both

Encrypting / Decrypting file with Mcrypt

喜你入骨 提交于 2019-11-26 01:15:00
问题 Trying to write a couple of functions that will encrypt or decrypt a file and am using the class found here to try and accomplish this: http://www.itnewb.com/v/PHP-Encryption-Decryption-Using-the-MCrypt-Library-libmcrypt The encryption function below seems to work, in that it appears to encrypt the file and place it in the intended directory. I\'m trying to decrypt the file now, and it just dies with the message \"Failed to complete decryption\" (which is coded in there...) There\'s nothing

How to add/remove PKCS7 padding from an AES encrypted string?

烈酒焚心 提交于 2019-11-25 23:47:10
问题 I\'m trying to encrypt/decrypt a string using 128 bit AES encryption (ECB). What I want to know is how I can add/remove the PKCS7 padding to it. It seems that the Mcrypt extension can take care of the encryption/decryption, but the padding has to be added/removed manually. Any ideas? 回答1: Let's see. PKCS #7 is described in RFC 5652 (Cryptographic Message Syntax). The padding scheme itself is given in section 6.3. Content-encryption Process. It essentially says: append that many bytes as

mcrypt is deprecated, what is the alternative?

99封情书 提交于 2019-11-25 23:25:49
问题 The mcrypt-extension is deprecated will be removed in PHP 7.2 according to the comment posted here. So I am looking for an alternative way to encrypt passwords. Right now I am using something like mcrypt_encrypt(MCRYPT_RIJNDAEL_128, md5($key, true), $string, MCRYPT_MODE_CBC, $iv) I need your opinion for the best/strongest way to encrypt passwords, the encrypted password should of course supported by PHP 7.xx and should also be decryptable because my customers do want to have an option to \

Laravel requires the Mcrypt PHP extension

我是研究僧i 提交于 2019-11-25 23:17:29
问题 I am trying to use the migrate function in Laravel 4 on OSX . However, I am getting the following error: Laravel requires the Mcrypt PHP extension. As far as I understand, it\'s already enabled (see the image below). What is wrong, and how can I fix it? 回答1: The web enabled extensions and command line enabled extensions can differ. Run php -m in your terminal and check to see if mcrypt is listed. If it's not then check where the command line is loading your php.ini file from by running php -