mcrypt

How To Enable Php Mcrypt on Mac Os X Lion 10.7.4

你离开我真会死。 提交于 2019-12-11 10:52:41
问题 I have been trying to enable mcrypt for two days in OS X. I read lots of document but I could not accomplish. Maybe it is because I am new in OS X environment. The brief summary what I have done so far is; I installed Xcode and installed Command Line Tools. Downloaded and extracted libmcrypt-2.5.8 and php-5.3.15. cd libmcrypt-2.5.8 ./configure && make && sudo make install The output of this is Libraries have been installed in: /usr/local/lib and some other logs like make[2]: Nothing to be

Is ECB a safe option if you don't expect duplicate results?

好久不见. 提交于 2019-12-11 09:35:23
问题 I want to encrypt long paragraphs of text using Rijndael-256 (the text has been compressed and converted to base64 before this). It is very unlikely for the two to be the same. But if they happen to be, would adding a random key to the start or end of the text secure it (regardless of whether they're the same), just in case users write the same text? If I make sure that no results are 100% the same, is ECB safe if you won't get duplicate results? Or is it like this: (using base64... not

mcrypt linux how to use rijndael 256 cbc

◇◆丶佛笑我妖孽 提交于 2019-12-11 05:52:42
问题 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 with aes 256 and cbc iv, padding 7? Rijndael is the same with aes.! this is the link i've found with the library i would like to use: http://linux.die.net/man/3/mcrypt 回答1: Are you asking how to use mcrypt ? Here's a basic skeleton: #include <mcrypt.h

PHP : OpenSSL equivilent of mcrypt : MCRYPT_3DES?

夙愿已清 提交于 2019-12-11 05:47:52
问题 We would like to convert our use of mcrypt to openssl. Here is our encryption function: mcrypt_ecb(MCRYPT_3DES,$key,$payload,MCRYPT_ENCRYPT) Here is our decryption function: mcrypt_ecb(MCRYPT_3DES,$key,$payload,MCRYPT_DECRYPT) What are the openssl_* equivalents of the above? Thanks. 回答1: I think you're looking for the EVP_Encrypt... functions with EVP_des_ede3 as the cipher (although you should really be using CBC mode rather than ECB). https://www.openssl.org/docs/crypto/EVP_EncryptInit.html

I want To Make mcrypt work on xampp windows with php 7.2 Error: Call to undefined function mcrypt_module_open()

情到浓时终转凉″ 提交于 2019-12-11 05:29:54
问题 For a testing purpose I want to get rid of this error " Uncaught Error: Call to undefined function mcrypt_module_open() " . I know its deprecated. Tried pasting the .dll file and addind this line in the php.ini (extension=php_mcrypt extension=libmcrypt) and no use .. Any Help ? 回答1: mcrypt is longer used and has now been deprecated since 7.1 and removed in 7.2 as it wasn't being maintained any longer. You can use functions such as: OpenSSL Encryption Libsodium PHP's inbuilt password hash

PHP decrypt not working using mcrypt_decrypt?

让人想犯罪 __ 提交于 2019-12-11 05:26:49
问题 Seems that mcrypt_decrypt can't proper decrypt my string (all works fine in var_dump except when decrypting - load_decrypted value is wrong). Any help would be appreciated. array 'salve_plain' => string 'a:1:{s:8:"modified";i:1321974656;}' (length=34) 'save_encrypted' => string '^ånÄc¥JŸRæk®»}J%áR–y #‡nwZX\µÚ™È§œ‘5‚<_¹M¿ÔT9k)…ª Ø' (length=64) 'save_encoded' => string 'XuVuxGOlA0qfUuYXa667fUoSEyXhBVKWeSAjh253EFpYXLUS2pnIp5yRNa3LgjxfuRNNv9RUOe67qmsphaoJ2A==' (length=88) array 'load_undecoded

what are NCFB and NOFB modes for?

时光毁灭记忆、已成空白 提交于 2019-12-11 01:38:46
问题 I can't find it anywhere, when I google it it shows this question posted here. Given that situation I want to ask precisely: What this "n" before cfb and ofb means ? 回答1: This is one reference to nCFB and nOFB that I could find: Note that CFB and OFB in the rest of the document represent the "8bit CFB or OFB" mode. nOFB and nCFB modes represents a n-bit OFB/CFB mode, n is used to represent the algorithm's block size . ... nOFB: The Output-Feedback Mode (in nbit). n Is the size of the block of

Incorrect key size when porting Crypto++ AES encryption to PHP's mcrypt

血红的双手。 提交于 2019-12-11 01:14:15
问题 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? Here's the C++ (diagnostics and sundries removed for simplicity): CFB_Mode<AES>::Encryption encryptor(g_encrypt_key, AES::DEFAULT_KEYLENGTH, g_encrypt_iv);

Openssl equivalent to mcrypt_get_block_size

两盒软妹~` 提交于 2019-12-11 00:55:09
问题 I am currently in the process of replacing Mcrypt with OpenSSL since Mcrypt will be deprecated in PHP 7.1. I need is a way to get the blocksize per algorithm like mcrypt_get_block_size(). I am wondering if there is an equivalent function to mcrypt_get_block_size() but it's pretty badly documented can't seem to find it. 回答1: php-openssl unfortunately doesn't have an API that would give you the cipher blockSize. If you really need it, you'd have to hard-code the blockSize (per algorithm).

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

微笑、不失礼 提交于 2019-12-10 17:57:30
问题 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 <stdio.h> #include <stdlib.h> #include <string.h> #include <mcrypt.h> #include <math.h> #include <stdint.h> int encrypt(void* buffer, int buffer_len, char* IV, char* key, int key_len){ MCRYPT td = mcrypt_module_open("rijndael-128", NULL, "cbc", NULL); int blocksize = mcrypt_enc_get_block_size(td); if( buffer_len % blocksize != 0 )