Questions tagged [mcrypt]

MCrypt, and the accompanying libmcrypt, are intended to be replacements for the old Unix crypt, except that they are under the GPL and support an ever-wider range of algorithms and modes. MCrypt has not been updated since 2007

MCrypt implements numerous cryptographic algorithms, mostly block ciphers and stream ciphers, some of which falls under export restrictions in the United States. Algorithms include , , arcfour, enigma, ghost, LOKI97, RC2, serpent, threeway, twofish, wake, XTEA

Caution

Please note that the MCrypt library has not been updated since 2007. The PHP project has moved to deprecate and ultimately remove MCrypt from the PHP core and other projects will likely follow suit. It is highly recommended you switch to OpenSSL or another maintained encryption project.

922 questions
11
votes
2 answers

Rijndael 256 Encrypt/decrypt between c# and php?

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…
arbme
  • 4,831
  • 11
  • 44
  • 57
11
votes
4 answers

Encrypt with CryptoJS and decrypt with PHP

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 =…
Papauha
  • 169
  • 1
  • 1
  • 8
11
votes
3 answers

cipher class and mcrypt_create_iv is slow at times

I am having an issue with my cipher class. At times it is very fast. Sometimes however it is slow. the code Im using is as follows class Cipher { private $securekey, $iv; function __construct() { $this->securekey =…
bretterer
  • 5,693
  • 5
  • 32
  • 53
10
votes
3 answers

Error while installing libsodium in PHP 7.1

I'm in PHP 7.1.25 and mcrypt is the current extension used and mcrypt will be deprecated in PHP 7.2 and Libsodium will be added to the core extensions in PHP 7.2 Now I would need to try installing libsodium in PHP 7.1 and see how it works, Followed…
VenkateshLB
  • 103
  • 1
  • 1
  • 4
10
votes
2 answers

How to install mcrypt on Docker

I have a Docker Container with Phalcon3 and php 7. I am trying to install the php extension Mcrypt without luck. If I do ssh to the container, and execute: apt-get update apt-get install php7.0-mcrypt I get the following: E: Unable to locate…
subharb
  • 3,374
  • 8
  • 41
  • 72
10
votes
1 answer

OpenSSL or Mcrypt? (openssl_encrypt or mcrypt_encrypt)

I guess it's a question of pros & cons. For simple data crypting: What are the real benefits of using openssl_encrypt over mcrypt_encrypt?
user1921724
10
votes
2 answers

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

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…
dondo
  • 1,208
  • 1
  • 12
  • 15
10
votes
4 answers

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

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…
dondo
  • 1,208
  • 1
  • 12
  • 15
9
votes
6 answers

Overloading a Native PHP Function to Encrypt Data for HIPAA Compliance

Background Information: I'm part of a team of developers that runs a web application that stores and retrieves HIPAA (medical) data. Recently, the HIPAA guidelines were updated to include a policy that requires that all identifying client…
Levi Hackwith
  • 9,232
  • 18
  • 64
  • 115
9
votes
2 answers

PHP crypt and salt - more clarification please

I was here yesterday and got some really great answers. I took what I got and put together, what I think will be a fairly secure algorithm. I'm having a problem using blowfish with a for loop that generates the salt. I'm using base64 characters and…
timmay
  • 127
  • 1
  • 4
8
votes
4 answers

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

Here is a PHP demo script that encrypts and decrypts data: \n"; $card_nbr_encrypted=encrypt_data($card_nbr); echo "card_nbr_encrypted: $card_nbr_encrypted…
davidjhp
  • 7,816
  • 9
  • 36
  • 56
8
votes
3 answers

Delphi DEC library (Rijndael) encryption

I am trying to use the DEC 3.0 library (Delphi Encryption Compedium Part I) to encrypt data in Delphi 7 and send it to a PHP script through POST, where I am decrypting it with mcrypt (RIJNDAEL_256, ECB mode). Delphi part: uses Windows, DECUtil,…
binar
  • 1,197
  • 1
  • 11
  • 24
8
votes
2 answers

Using PHP mcrypt with Rijndael/AES

I am trying to encrypt some text messages using mcrypt from php and the cipher Rijndael, but I am not sure about the MCRYPT_MODE_modename (according to PHP's manual these are available "ecb", "cbc", "cfb", "ofb", "nofb" or "stream" but I read there…
riviraz
  • 479
  • 1
  • 10
  • 22
8
votes
1 answer

Preparing for removal of Mcrypt in PHP 7.2

So as time moves on mcrypt will go in PHP 7.2. Of course there is an alternative: openssl. I find it difficult to switch from mcrypt to openssl, using AES 256 CBC and preserving IVs. I am sort of new to cryptography, so I don't really know…
Scrumplex
  • 522
  • 1
  • 6
  • 15
8
votes
3 answers

Error installing php5-mcrypt

Just today I signed up with Google Cloud Compute Engine. I did everything but then I stuck into an error while installing php5-mcrypt extension. Error: root@instance-2:~# sudo apt-get install php5-mcrypt Reading package lists... Done Building…
Aditya Giri
  • 1,786
  • 18
  • 33