mcrypt

Cryptography libraries conflict (MCrypt, libgcrypt)

Hello, I'm trying to perform encryption and decryption (Rijndael 256, ecb mode) in two different components: 1. PHP - Server Side (using mcrypt) 2. C + + - Client Side (using gcrypt) I ran into a problem when the client side could not decrypt correctly the encrypted data (made by the server side) so... i checked the: 1. initial vector -...

Adding mcrypt to Plesk

Hello, I am running Plesk v8.2.0 and I have a program that needs mcrypt module installed but I cant find any relevent infromation on how to get mcrypt setup on Plesk. It is on a Unix based server. Does anyone have any ideas on how to set this up? Any infromation would be greatly appreciated ...

Un-encrypting / re-encrypting a ColdFusion encrypted string in PHP

Hi there, I'm in the unenviable position where I have to maintain functionality with an existing ColdFusion application. As part of it's login process the Coldfusion app stores a cookie with an encrypted string. encrypt(strToEncrypt, theKey, "AES", "Base64") I can successfully decrypt this string in PHP using MCrypt and the followi...

PHP AES decryption

Hi All, I'm really struggling to decrypt a given cipher text in PHP and I'm hoping that one of you will be able to spot where I'm going wrong with this one. So this is the string I'm trying to decode Wq+J2IlE7Cug1gJNiwy1beIcFggGhn+gZHkTCQ4J/DR3OY45OMs4RXN850xbfAmy I know its encrypted with AES/CBC/PKCS5Padding with an IV of 2ZqVSH...

Overloading a Native PHP Function to Encypt 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 information be encrypted when it is "at rest" (stored in the database and not being accessed). The...

Localhost extensions check

Hi. I have to install big CMS on my localhost, but it requires mcrypt, and pdo_mysql. Before I've tried to install them, I've tried to access site, but I only got blank page. I'm running apache on windows, so I heard that I have to keep dll's in php extension folder. I've downloaded from dlldll.com (it's not ad) files php_pdo_mysql.dll,...

mcrypt blowfish php slightly different results when compared to java and .net

Here is some example code with altered key values and payload: $key = '/4rTInjwg/H/nA=='; $key = base64_decode($key); $data = 'val=100|val=200|val=300|val=400|val=500|val=600|val=700|val=800|val=900|'; $data.= 'val2=100|val2=200|val2=300|val2=400|val2=500|val2=600|val2=700|val2=800|val2=900|'; $data.= 'val3=100|val3=200|val3=300|val3=4...

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 you say the IV should be random, by this do you mean don't use the same IV more then once ...

AES in javascript that matches PHP's mcrypt

Is there any javascript libs that lets you encrypt and decrypt 256 bit AES the way you do it with mcrypt in PHP (and get the same result of course)? I want to give it a variable-length message and a 32 chars key. All libs i find wants fixed-length blocks of cleartext and byte-arrays of keys... This is how it's done in php: $iv_size = m...

PHP difference between mcrypt and openssl?

Why have these two methods of using blowfish in ecb-mode different outputs? <?php echo bin2hex(mcrypt_encrypt("blowfish", "test", "test", "ecb"))."\n"; echo bin2hex(openssl_encrypt("test", "bf-ecb", "test", true))."\n"; ?> ...

Relation between input and ciphertext length in AES

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 i...

How are my C# and PHP decryption methods different?

I've inherited some C# code and need to port it to PHP. Here it is: string key = "some key"; string strEncrypted = "some encrypted string"; byte[] hashedKey = new MD5CryptoServiceProvider().ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); byte[] strToDecrypt = Convert.FromBase64String(strEncrypted); TripleDESCryptoServiceProvider tripleD...

Mac Snow Leopard Mcrypt extension

Hi Guys. Im running Mac OS X Snow Leopard 10.6. When trying to get into phpMyAdmin, I am getting the following error: "Cannot load mcrypt extension. Please check your PHP configuration." Does anyone know how to fix this? I'm not fantastically technical so a simple explanation would be welcome! Cheers, Mark. ...

Encrypt with PHP and Decrypt with Java

I have to write a program to decrypt a message using JAVA. The message is encrypted using Triple DES / ECB implemented in PHP. I have tried a few different settings on the algorithm, mode, and padding schema. I do not get the correct result. What is missing? Here is the PHP program that encrypt the message: $config_mcrypt_ecb_key = "1...

Incorrect key size in PHP mcrypt when porting CryptoPP AES encryption to PHP's mcrypt

Earlier I managed to port some C++ CryptoPP Rijndael_128 CBC code to MCrypt PHP, but now I'm having problems with CFB mode. The C++ and PHP results do not match (well the first byte matches but this could be coincidence, everything else doesn't). With some diagnostics, it looks like PHP's mcrypt is not setting the key length correctly? ...