mcrypt

Relation between input and ciphertext length in AES

一个人想着一个人 提交于 2019-11-30 03:55:32
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 is due to the padding of my input, so that it fits the cipher's requirments? Is there a way to accurately predict the maximum length of the ciphertext based on the maximum length of the input? And for bonus points: should I be storing the ciphertext base64-encoded

PHP 7.2 with mcrypt in Windows

こ雲淡風輕ζ 提交于 2019-11-29 21:47:27
问题 There are some huge legacy systems whose dependencies on PHPs' mcrypt are extremely important and vital (including the data storage in database). I need to find a way to maintain this library while upgrading to PHP 7.2 (which already worked fine). My local test environment is Windows. The live environment is run on CentOS. Some of the answers I have seen is decrypting and change mcrypt to openssl ( I think that's not possible at the moment since there's a lot of data to decrypt ). Another way

centos LNMP环境搭配

牧云@^-^@ 提交于 2019-11-29 18:27:54
centos 版本6.6 **1. 关闭防火墙** service iptables stop **2. 安装nginx** 方法1:rpm -ivh http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.8.0-1.el6.ngx.x86_64.rpm 方法2:yum install nginx #默认不行 推荐: #cd /etc/yum.repos.d/ #vim nginx.repo # nginx.repo [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1 这样就可以使用 #yum install nginx 安装更新了 chkconfig nginx on #开机启动 访问测试 你可以用下列方法检查配置文件是否有语法错误 /etc/init.d/nginx configtest **3. 安装php** yum install php php-fpm php -m #查看已经安装的扩展 yum install php-mysql php-mbstring php-gd php-xml php-mcrypt #根据需要按照扩展库 chkconfig

Mcrypt and base64 with PHP and c#

和自甴很熟 提交于 2019-11-29 14:29:31
问题 I have written the same methods in two platforms which I believe should result same thing but its not happening. I have encrypted the same text with same key which result different. Can someone figure it out why is it happening ? String: this is test Key: 1234567812345678 PHP encrypted string: ybUaKwQlRNwOjJhxLWtLYQ== C# encrypted string: r2YjEFPyDDacnPmDFcGTLA== C# functions static string Encrypt(string plainText, string key) { string cipherText; var rijndael = new RijndaelManaged() { Key =

PHP Mcrypt, how secure is it really? [closed]

左心房为你撑大大i 提交于 2019-11-29 14:21:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . At the moment I am working on a project that will handle some quite sensitive personal information, although it are not backaccount numbers it is still sensitive personal information and I want to do everything I

MCRYPT_DEV_RANDOM freezes but MCRYPT_DEV_URANDOM works

大憨熊 提交于 2019-11-29 13:59:23
I am trying to create an IV with the function: mcrypt_create_iv(32, MCRYPT_DEV_RANDOM) this causes the script to time out after more than 60 seconds. (maybe more?) but when I use URANDOM , it works fine almost instantly. From what I read it should take about 4 seconds with MCRYPT_DEV_RANDOM , but it is definitely taking too long. There is nothing in the error log. I have it installed with apache2 and php5 on an ubuntu 12.04 server. I have run the exact same code on my centos server without issues. Both RANDOM and Unblocking-RANDOM (URANDOM) will supply you random data, but while RANDOM will

php error: The Encrypt library requires the Mcrypt extension in codeigniter

谁说我不能喝 提交于 2019-11-29 12:26:29
I have a login and sign up form and use the encrypt library to encrypt the password.. I am using Xampp for my server and my system works correctly.. code to encrypt the password: $this->encrypt->encode('my password'); add encrypt library $autoload['libraries'] = array('encrypt'); and setting the secret key in config: $config['encryption_key'] = 'nmsc encrypt secret key'; My code works well using xampp server in windows but when Im trying to upload my website to ubuntu server I've got an error says The Encrypt library requires the Mcrypt extension how to fix that problem? refering this guide

how to sync encryption between delphi and php using dcpcrypt

佐手、 提交于 2019-11-29 10:29:05
问题 I'm using Delphi 2009 and most of the answers I've seen here are for 2010+ I am trying to sync encryption (delphi) to decryption (php) and failing. generate the encrypted string in delphi: program Project4; {$APPTYPE CONSOLE} uses SysUtils, DCPcrypt2, DCPsha1, DCPblockciphers, DCPdes, EncdDecd; var des: tdcp_des; enc,dec: ansistring; begin try des:=tdcp_des.Create(nil); des.InitStr('test', tdcp_sha1); enc:=encodestring(des.EncryptString('this is a test')); des.Free; des:=tdcp_des.Create(nil);

How to install mcrypt extension on mac os x yosemite (10.10)

蓝咒 提交于 2019-11-29 09:57:31
问题 I've updated my Mac OS X to Yosemite, but doing that I over write all my dev environment. So now, to run Laravel 4 on my local apache I need to install the Mcrypt extension, but everything that i've tried i fail. Even the steps that have worked on OS X Mavericks (10.9) Anybody has the same issue? Thanks in advance. Cheers 回答1: I just installed it right now on my Mavericks installation using homebrew and it worked surprisingly well. Can't say whether or not it will work so well on Yosemite but

mcrypt encrypt adding s bunch of '%00' to end of string

 ̄綄美尐妖づ 提交于 2019-11-29 07:11:38
Working with OAuth and encrypting the keys with the following function with a string which we'll call 'foo' (actually an OAuth token) public function encrypt( $text ) { // add end of text delimiter $data = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $this->key, $text, MCRYPT_MODE_ECB, $this->iv ); return base64_encode( $data ); } When I decrypt it using the inverse function, I end up with: Function: public function decrypt( $text ) { $text = base64_decode( $text ); return mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $this->key, $text, MCRYPT_MODE_ECB, $this->iv ); } Result: foo%00%00%00%00%00%00%00%00%00%00