mcrypt

Call to undefined function mcrypt_decrypt() - even when php5-mcrypt installed

给你一囗甜甜゛ 提交于 2019-11-27 15:13:41
问题 So I can't stop getting the error: PHP Fatal error: Call to undefined function mcrypt_decrypt() in Even when I have php5_mcrypt installed, I've reinstalled php quite a few times but I can't get it working! More info: mandatory@mandatorys-box:~/Desktop/bots$ dpkg -l | grep php ii libapache2-mod-php5 5.5.3+dfsg-1ubuntu2.1 amd64 server-side, HTML-embedded scripting language (Apache 2 module) ii php5 5.5.3+dfsg-1ubuntu2.1 all server-side, HTML-embedded scripting language (metapackage) ii php5-cli

Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

牧云@^-^@ 提交于 2019-11-27 14:40:06
I've successfully installed mcrypt via homebrew but I'm struggling to find the path to mcrypt.so to include it as an extension in php.ini . mcrypt was installed at /usr/local/Cellar/mcrypt/2.5.8 . Tree: -- AUTHORS |-- ChangeLog |-- INSTALL_RECEIPT.json |-- NEWS |-- README |-- TODO |-- bin | `-- libmcrypt-config |-- include | |-- mcrypt.h | `-- mutils | `-- mcrypt.h |-- lib | |-- libmcrypt.4.4.8.dylib | |-- libmcrypt.4.dylib -> libmcrypt.4.4.8.dylib | `-- libmcrypt.dylib -> libmcrypt.4.4.8.dylib `-- share |-- aclocal | `-- libmcrypt.m4 `-- man `-- man3 `-- mcrypt.3 I tried to include mcrypt.h

Decrypting strings in Python that were encrypted with MCRYPT_RIJNDAEL_256 in PHP

浪尽此生 提交于 2019-11-27 08:41:33
I have a function in PHP that encrypts text as follows: function encrypt($text) { $Key = "MyKey"; return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $Key, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); } How do I decrypt these values in Python? To decrypt this form of encryption, you will need to get a version of Rijndael. One can be found here . Then you will need to simulate the key and text padding used in the PHP Mcrypt module. They add '\0' to pad out the text and key to the correct size. They are using a 256

Part II: How to make Ruby AES-256-CBC and PHP MCRYPT_RIJNDAEL_128 play well together

北城以北 提交于 2019-11-27 06:52:16
问题 This question is a continuation of my last one, regarding How to make Ruby AES-256-CBC and PHP MCRYPT_RIJNDAEL_128 play well together. I've got that working now, but I'm still struggling to go the other direction. The PHP generated cryptogram appears to have all the information that was provided, but I cannot get the Ruby code to decrypt it without error. Here's the PHP code I'm using to generate the cryptogram: $cleartext = "Who's the clever boy?"; $key = base64_decode("6sEwMG

How to install mcrypt extension in xampp

不问归期 提交于 2019-11-27 06:05:53
问题 how to install mcrypt in xampp on windows? My PHP Version 7.0.5 and xampp pack have not mcrypt extension so how can i install mcrypt on xampp ? 回答1: The recent versions of XAMPP for Windows runs PHP 7.x which are NOT compatible with mbcrypt. If you have a package like Laravel that requires mbcrypt, you will need to install an older version of XAMPP. OR, you can run XAMPP with multiple versions of PHP by downloading a PHP package from Windows.PHP.net, installing it in your XAMPP folder, and

Encrypt with CryptoJS and decrypt with PHP

巧了我就是萌 提交于 2019-11-27 05:41:22
问题 On the client side (mobile device) I encrypt a users password with CryptoJS: var lib_crypt = require('aes'); $.loginButton.addEventListener('click', function(e){ var key = lib_crypt.CryptoJS.enc.Hex.parse('bcb04b7e103a0cd8b54763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3'); var iv = lib_crypt.CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f'); var encrypted = lib_crypt.CryptoJS.AES.encrypt($.passwordInput.value, key, { iv: iv }); var password_base64 = encrypted.ciphertext.toString(lib

php: mcrypt_encrypt to openssl_encrypt, and OPENSSL_ZERO_PADDING problems

[亡魂溺海] 提交于 2019-11-27 05:03:44
I have this mcrypt_encrypt call, for a given $key, $message and $iv: $string = mcrypt_encrypt(MCRYPT_3DES, $key, $message, MCRYPT_MODE_CBC, $iv); I'd like to change the mcrypt_encrypt call to an openssl_encrypt one, to future-proof this. By having $mode = 'des-ede3-cbc' or $mode = '3DES'; and $options = true I get the more similar response, but not identical. Is there other way to call it to get a perfect match? I'm getting this (base64_encoded) for a lorem-ipsum $message + $key combinations, so I'm starting to believe one function or the other are padding somewhat the message before

Rijndael 256 Encrypt/decrypt between c# and php?

若如初见. 提交于 2019-11-27 04:53:15
UPDATED I have made the changes to the C# code so it uses a block size of 256. but now the hello world looks like this http://pastebin.com/5sXhMV11 and I cant figure out what I should use with rtrim() to get ride of the mess at the end. Also when you say the IV should be random, by this do you mean don't use the same IV more then once or is the way I have coded it wrong? Thanks again! Hi, I'm trying to decrypt a string with PHP that was encrypted in C#. I can't seem to get PHP to decrypt it using mcrypt and could do with some help please. I get the following error with php so I am guessing I'm

How to do AES256 decryption in PHP?

半腔热情 提交于 2019-11-27 04:42:34
I have an encrypted bit of text that I need to decrypt. It's encrypted with AES-256-CBC. I have the encrypted text, key, and iv. However, no matter what I try I just can't seem to get it to work. The internet has suggested that mcrypt's Rijndael cypher should be able to do this, so here's what I have now: function decrypt_data($data, $iv, $key) { $cypher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); // initialize encryption handle if (mcrypt_generic_init($cypher, $key, $iv) != -1) { // decrypt $decrypted = mdecrypt_generic($cypher, $data); // clean up mcrypt_generic

How to make Ruby AES-256-CBC and PHP MCRYPT_RIJNDAEL_128 play well together

这一生的挚爱 提交于 2019-11-27 04:28:41
问题 I'm generating data to send from a Ruby stack to a PHP stack. I'm using the OpenSSL::Cipher library on the Ruby side and the 'mcrypt' library in PHP. When I encrypt using 'aes-256-cbc' (256-bit block size) in Ruby I need to use MCRYPT_RIJNDAEL_128 (128-bit block size) in PHP to decrypt it. I suspect the Ruby code that is broken, because the cipher.iv_len is 16; I believe it should be 32: >> cipher = OpenSSL::Cipher::Cipher.new('aes-128-cbc') => #<OpenSSL::Cipher::Cipher:0x3067c5c> >> cipher