mcrypt

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

≡放荡痞女 提交于 2019-11-29 07:05:59
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 of the mcrypt library ), I am attempting to decrypt Blowfish encrypted query string parameters. Assume

Encrypting data in Cocoa, decoding in PHP

三世轮回 提交于 2019-11-29 05:18:04
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 their own data (verified to make sure there wasn't some PEBKAC issue at hand). I have a suspicion that

Docker-php-ext-install mcrypt missing folder

笑着哭i 提交于 2019-11-29 05:08:06
问题 I try to install mcrypt in my docker image based on php:7.2-apache . Therefore I use the RUN-Command from the documentation and also answerd here but I receive this error: error: /usr/src/php/ext/mcrypt does not exist usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...] ie: /usr/local/bin/docker-php-ext-install gd mysqli /usr/local/bin/docker-php-ext-install pdo pdo_mysql /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop if custom .

Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'

两盒软妹~` 提交于 2019-11-29 04:04:38
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 PATH="~/.composer/vendor/bin:$PATH" I am running on a Mac. Is there a simple way I can set up my bash

Relation between input and ciphertext length in AES

荒凉一梦 提交于 2019-11-29 00:28:52
问题 Having recently started using cryptography in my application, I find myself puzzled by the relationship between the input text length and the ciphertext it results in. Before applying crypto, it was easy to determine the database column size. Now, however, the column size varies slightly. Two questions: Am I correct in assuming this is due to the padding of my input, so that it fits the cipher's requirments? Is there a way to accurately predict the maximum length of the ciphertext based on

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

*爱你&永不变心* 提交于 2019-11-28 23:44:43
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 5.5.3+dfsg-1ubuntu2.1 amd64 command-line interpreter for the php5 scripting language ii php5-common 5

Best practices for storing bank information in a database

痴心易碎 提交于 2019-11-28 15:57:22
问题 Summary of answers: Don't do it. The legal and financial implications will be disastrous. Look for established third party solutions or hire an expert. Never store any sensitive information on a shared server. Research for the most appropriate encryption mechanism. I am buiding a website for a customer that needs to store his clients' bank info (routing + account number) in the db for direct deposit. Here are some specifics: 1) The website will initially be on a shared hosting server (this is

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

房东的猫 提交于 2019-11-28 12:06:57
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/aKdBk5Fa2rR6vVw==\n"); $iv = base64_decode("vCkaypm5tPmtP3TF7aWrug=="); $cryptogram = mcrypt_encrypt(MCRYPT_RIJNDAEL

How to install mcrypt extension in xampp

无人久伴 提交于 2019-11-28 11:11:05
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 ? MrMoxy 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 configuring php.ini and httpd.conf to use the correct version of PHP for your site. Right from the PHP

Generate an N-digit random number

强颜欢笑 提交于 2019-11-28 06:47:39
I want to generate a 6 digit random number using the PHP mt_rand() function. I know the PHP mt_rand() function only takes 2 parameters: a minimum and a maximum value. How can I do that? Something like this ? <?php $a = mt_rand(100000,999999); ?> Or this, then the first digit can be 0 in first example can it only be 1 to 9 for ($i = 0; $i<6; $i++) { $a .= mt_rand(0,9); } You can use the following code. <?php $num = mt_rand(100000,999999); printf("%d", $num); ?> Here mt_rand(min,max); min = Specifies the lowest number to be returned. max = Specifies the highest number to be returned. ` Examples: