mcrypt

creating encrypted passwords in openfire MySQL via PHP

那年仲夏 提交于 2019-11-27 03:39:53
问题 Openfire stores encrypted passwords in a database using blowfish encryption. http://svn.igniterealtime.org/svn/repos/openfire/trunk/src/java/org/jivesoftware/util/Blowfish.java is the java implementation for how encrypt / decrypt functions work in openfire. My goal is to create new user entries in the database via PHP and MySQLI. All of the variations I've tried have yielded results that don't match what already exists in the database. For example:

MCrypt rijndael-128 to OpenSSL aes-128-ecb conversion

别来无恙 提交于 2019-11-27 01:37:58
Since Mcrypt is deprecated, I want to use OpenSSL instead in my code since we already using php 7.0.17 in our server and there's no tell when they upgrade it. Some third party API (hosted on PHP 5.x probably and using mcrypt ), is taking encrypted data. They've provided methods which they are using to encrypt/decrypt strings. Here are they $secret = 'a0a7e7997b6d5fcd55f4b5c32611b87c' ; public function encrypt128($str) { $block = mcrypt_get_block_size("rijndael_128", "ecb"); $pad = $block - (strlen($str) % $block); $str .= str_repeat(chr($pad), $pad); return base64_encode(mcrypt_encrypt(MCRYPT

Cross platform (php to C# .NET) encryption/decryption with Rijndael

早过忘川 提交于 2019-11-27 00:47:16
I'm currently having a bit of problem with decrypting a message encrypted by php mcrypt. The php code is as following: <?php //$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); $iv = "45287112549354892144548565456541"; $key = "anjueolkdiwpoida"; $text = "This is my encrypted message"; $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CBC, $iv); $crypttext = urlencode($crypttext); $crypttext64=base64_encode($crypttext); print($crypttext64) . "\n<br/>"; ?> The the encrypted message is then sent to a ASP.NET platform (C#). However, I'm having problem

Fatal error: Call to undefined function mcrypt_encrypt()

随声附和 提交于 2019-11-27 00:45:34
问题 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

Issue in installing php7.2-mcrypt

≡放荡痞女 提交于 2019-11-27 00:39:02
As I'm trying to load mcrypt extension module from PHP 7.2.X version. So I tried to make use of PECL library that is compatible to the current version of my PHP, in order to get installed and followed this link: Installing mcrypt on PHP 7.2 during installation! These below are the result's obtained after executing certain commands on the terminal. root@YYY:/var/www/html/orocrm# apt install php-pear Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libllvm4.0 Use 'sudo apt

mcrypt_decrypt() error change key size

微笑、不失礼 提交于 2019-11-26 21:10:45
问题 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? 回答1: 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

PHP7.1 mcrypt alternative

泄露秘密 提交于 2019-11-26 20:56:38
Mcrypt function has been deprecated as of PHP 7.1.0. My deprecated string encode / decode functions: $key: secret key $str: string $encoded = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $str, MCRYPT_MODE_CBC, md5(md5($key)))); $decoded = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($str), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); Can you suggest some alternatives? You should use openssl_encrypt instead. Regards! Consider using defuse or RNCryptor , they provide a complete solution, are being maintained and is correct. For MCRYPT_RIJNDAEL_256 I posted a

Which PHP mcrypt cipher is safest?

二次信任 提交于 2019-11-26 20:14:10
问题 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 回答1: 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

Decrypting strings in Python that were encrypted with MCRYPT_RIJNDAEL_256 in PHP

半城伤御伤魂 提交于 2019-11-26 17:46:25
问题 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? 回答1: 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

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

这一生的挚爱 提交于 2019-11-26 17:06:09
问题 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,