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
3
votes
1 answer

AES encryption result only part of data are correct (using mcrypt lib)

I download a sample code of AES encryption from https://gist.github.com/2436364 I modified part of the source code to meet my project requirement as below: #include #include #include #include #include…
YS Wang
  • 177
  • 13
3
votes
3 answers

How to deal with special characters in a string

I have a php script creating an encoded value, for example: m>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[Éå¹UçfU5T°äÙ“©”ˆÇVÝ] [’e™a«Ã°7#dÉJ> I then need to decode this in a vb.net application The problem is that value above can have any characters. And VB.net…
shaiss
  • 2,000
  • 5
  • 22
  • 33
3
votes
0 answers

Cannot load mcrypt extension

phpMyAdmin reports Cannot load mcrypt extension. I'm running Centos 6.2 x86_64 with PHP 5.3.3 and Zend Engine v2.3.0. This is what I've checked so far: php.ini is in /usr/local/zend/etc/php.ini as reported by phpinfo();. PHP…
Jeff Benshetler
  • 640
  • 6
  • 13
3
votes
5 answers

Why are these strange characters appearing in mcrypt?

I encrypt and decrypt successfully, but when I decrypt the value, there appears strange characters at the end of the string, "���". The initial $_POST['value'] do not have any blank space or any strange character. How can I solve this? I encrypt…
David
3
votes
1 answer

Is there a JavaScript library that does Rijndael 256bit encryption like PHP?

I've been extensively using Rijndael 256bit encryption in PHP for my API and would like to use it for my API wrapper that is written in JavaScript as well, but I've been unable to find a solution that gets the same result as in PHP. By what PHP does…
kingmaple
  • 4,200
  • 5
  • 32
  • 44
2
votes
1 answer

Encryption using Crypto-js in Javascript, Decrypt in PHP with mcrypt?

I have a simple JavaScript game that sends a score to PHP by adding the score to the URL and then PHP uses GET to grab it. Obviously, this is about as easy to cheat as it could possibly be. I'd like to make it mildly irritating to cheat the game.…
2
votes
1 answer

How to use CBC encryption mode in PHP

I'm trying to encrypt a string, 50-150 characters long, with AES in a mode other than ECB (due to security issues). I wrote an encryption class and am able to encrypt/decrypt perfectly in ECB mode, however when I switch to CBC, CTR or OFB mode, I…
Matic
  • 469
  • 2
  • 8
  • 16
2
votes
2 answers

PHP mycrypt problem, weird characters/warnings

I have no idea what I'm doing wrong. I just need to be able to encrypt and decrypt without getting weird characters or warnings. It says I'm supposed to be using an IV of length 16 and that I'm using a length of 9 but "0123456789abcdef" is 16…
mmundiff
  • 3,875
  • 7
  • 32
  • 46
2
votes
3 answers

Enabling or Compiling PHP with mcrypt?

phpMyAdmin states that the mcrypt extension is missing. I do have php_mcrypt.dll (in the ext folder) and also libmcrypt.dll (in the PHP root folder), and I did enable extension=php_mcrypt.dll in the php.ini file, though phpMyAdmin is still stating…
Carpet
  • 527
  • 2
  • 10
  • 17
2
votes
1 answer

Encryption/Hashing issues

I'm working on a little script that will allow me to store relatively secure information in a cookie to validate a user login without the use of sessions. Part of the output is an encrypted salt to use when generating a hmac_hash with some of the…
itsreeyan
  • 174
  • 1
  • 9
2
votes
1 answer

mcrypt linux how to use rijndael 256 cbc

I am working on linux/ubuntu. I found out that mcrypt is automatically included as a library in this platform. I want to create an encryption with aes 256 and cbc padding 7 (iv). Could someone please give me an example of how to encrypt a string…
sunset
  • 1,359
  • 5
  • 22
  • 35
2
votes
1 answer

What could cause PHP mcrypt to mangle data?

I'm using an mcrypt function to encrypt a block of text using TripleDES. 90% of the time it works as it should and I can decrypt just fine. The other 10% though I just cannot decrypt it at all - as if I have the wrong key or the data is mangled. The…
2
votes
1 answer

Javascript implementation of AES compatible with PHP's mcrypt

Problem I need to encrypt data in Javascript and decrypt it in PHP. Mcrypt seems the way to go on the PHP side, and AES seems thoroughly good enough, but I'm having trouble finding a javascript decryption algorithm that matches it. Any…
Fishtoaster
  • 1,809
  • 2
  • 20
  • 36
2
votes
3 answers

Java decrypt error: data not block size aligned

I'm trying to encrypt data between my android application and a PHP webservice. I found the next piece of code in this website: http://schneimi.wordpress.com/2008/11/25/aes-128bit-encryption-between-java-and-php/ But when I try to decrypt I get the…
SERPRO
  • 10,015
  • 8
  • 46
  • 63
2
votes
1 answer

How to encrypt with openSSL using the DES-CBC method

Actually I'm using Mcrypt but I'm moving to OpenSSL and I need to be able to use it the exact same way as Mcrypt. This is how I'm encrypting mcrypt_encrypt(MCRYPT_DES, $key, $text, MCRYPT_MODE_cbc, "\0\0\0\0\0\0\0\0"); For the decryption, I already…
CE_
  • 1,078
  • 2
  • 16
  • 33