mcrypt

Fatal error: Call to undefined function mcrypt_encrypt()

给你一囗甜甜゛ 提交于 2019-11-28 04:49:08
NOTE: The libraries MCrypt support depend on have not been updated in years and MCrypt should no longer be considered a viable or secure method of encrypting data. What's more, MCrypt has been deprecated in PHP 5, and removed entirely in PHP 7. If you have any code that runs MCrypt you should refactor it to use a more modern encryption library. Does anyone know why this error message: (Call to undefined function mcrypt_encrypt() ) displays when I run the following code below? Am I missing some steps perhaps any setting in PHP I have to do before this code can work? $key = 'password to (en/de

php error: The Encrypt library requires the Mcrypt extension in codeigniter

心已入冬 提交于 2019-11-28 04:46:10
问题 I have a login and sign up form and use the encrypt library to encrypt the password.. I am using Xampp for my server and my system works correctly.. code to encrypt the password: $this->encrypt->encode('my password'); add encrypt library $autoload['libraries'] = array('encrypt'); and setting the secret key in config: $config['encryption_key'] = 'nmsc encrypt secret key'; My code works well using xampp server in windows but when Im trying to upload my website to ubuntu server I've got an error

Why is mcrypt_encrypt() putting binary characters at the end of my string?

主宰稳场 提交于 2019-11-28 01:07:25
Here is a PHP demo script that encrypts and decrypts data: <? $encryptionkey = 'h8y2p9d1'; $card_nbr = "1234"; echo "original card_nbr: $card_nbr <br>\n"; $card_nbr_encrypted=encrypt_data($card_nbr); echo "card_nbr_encrypted: $card_nbr_encrypted <br>\n"; $card_nbr_decrypted=decrypt_data($card_nbr_encrypted); echo "card_nbr_decrypted: $card_nbr_decrypted <br>\n"; $len=strlen($card_nbr_decrypted); echo "length: $len <br>\n"; function encrypt_data($text){ global $encryptionkey; $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);

PHP: Warning mcrypt_generic_init(): Iv size is incorrect; supplied length: 12, needed: 8

大城市里の小女人 提交于 2019-11-28 00:40:51
问题 Basic Facts: $algorithm = MCRYPT_BLOWFISH; $mode = MCRYPT_MODE_CBC; $randSource = MCRYPT_DEV_URANDOM; Note This is not a strict coding question. Context: CentOS 7, Apache 2.4.12, & PHP 5.6.20. I am making an HTML email with a "verify your email address" link that allows a registration process to complete. Everything on my virtual private server is UTF-8, and all form and query string input is processed with multi-byte (mb) funcions. Background As an experiment ( I know about the age and state

mcrypt_decrypt() error change key size

ぐ巨炮叔叔 提交于 2019-11-27 22:48:49
mcrypt_decrypt(): Key of size 15 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported How Can I fix this issue? my key is set - can not change it. It has to be a local change, I think my local PHP version is too advanced for the project I loaded. How can I fix this? Did you update to 5.6? It says Invalid key and iv sizes are no longer accepted. mcrypt_decrypt() will now throw a warning and return FALSE if the inputs are invalid. Previously keys and IVs were padded with '\0' bytes to the next valid size. Reference Read the last line of that quote, and there you will find

Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'

…衆ロ難τιáo~ 提交于 2019-11-27 21:20:54
问题 I have successfully installed Laravel, but after running php artisan serve and going to localhost:8000 I get this error: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' I have checked phpinfo() on localhost:8888 and it says that mcrypt is properly installed. However the only thing I can think of is that maybe my path is wrong? in my .bash_profile I have PATH=/usr/local/bin:$PATH Every time I try to run Laravel commands I have to type this in the terminal: export

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

痞子三分冷 提交于 2019-11-27 20:49:28
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.key_len => 16 >> cipher.iv_len => 16 >> cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc') => #<OpenSSL

Which PHP mcrypt cipher is safest?

…衆ロ難τιáo~ 提交于 2019-11-27 20:05:17
So guys, there's plenty of different ciphers available - but which one is the safest to use nowadays? List: http://www.php.net/manual/en/mcrypt.ciphers.php Thomas Pornin If unsure use AES (also known as "Rijndael") with a 128-bit key. If you have developed some kind of fetish about key size then you could fulfill your irrational qualms by selecting a larger key, e.g. 192 or 256 bits; the extra cost is not high (+40% workload for AES-256, compared to AES-128, and it takes a very very fast network to actually observe that difference). Beware that, regardless of the key size chosen, the correct

Encrypting data in Cocoa, decoding in PHP

扶醉桌前 提交于 2019-11-27 19:04:12
问题 The situation I'm trying to solve: in my Cocoa app, I need to encrypt a string with a symmetric cipher, POST it to PHP, and have that script decode the data. The process needs to work in reverse for returning an answer (PHP encodes, Cocoa decodes). I'm missing something because even though I can get both the key and initialization vector (iv) to be the same in both PHP and Cocoa, the decoding never works when one app sends its encoded data to the other. Both work just fine encoding/decoding

Mcrypt js encryption value is different than that produced by PHP mcrypt / Mcrypt JS decrypt doesn't work for UTF-8 chars

风格不统一 提交于 2019-11-27 15:15:44
I have been trying to implement mcrypt encryption/ decryption technique on both server end, PHP and client end. I am trying to use mcrypt.js library at the moment as: <?php $key = 'testtesttesttesttesttesttesttest'; function string_encrypt($string, $key) { $crypted_text = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $key, $string, MCRYPT_MODE_ECB ); return base64_encode($crypted_text); } function string_decrypt($encrypted_string, $key) { $decrypted_text = mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $key, base64_decode($encrypted_string), MCRYPT_MODE_ECB ); return trim($decrypted_text); } echo 'Provided Text: