Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Encryption in Apache vs IIS
#1

[eluser]josen[/eluser]
I have a Codeigniter-based application that utilizes the encryption from Codeigniter.
You know, $this->encrypt->encode($somevar,$this->config->item('encryption_key'))

It's working well in Apache and MySQL, decoding and everything.

Now I'm trying to migrate to Windows Server 2008 R2 and IIS 7.5.
The problem is in IIS the old database from Apache is not decoding properly.
The values decode to some weird alien syntax.

I'm suspecting that the mcrypt library might not be activated in IIS (that's another problem).
Still, even if it's because of the mcrypt thing, the fact that it doesn't behave the same way on two different web servers annoys me.

What do you guys think? Did u ever experience something like that?

Thank you.
#2

[eluser]WanWizard[/eluser]
The encryption library uses PHP's mcrypt library if available.

If you old platform had this library installed, but the new one doesn't, you have a problem, as the encryption results between the two are different.
Make sure both PHP installations have the same libraries available.

That might be annoying to you, but it's your responsability that the platforms are equal.
You don't expect things to "just work" if you move from one environment to another without checking the prerequisites do you?
#3

[eluser]josen[/eluser]
[quote author="WanWizard" date="1283360678"]The encryption library uses PHP's mcrypt library if available.

If you old platform had this library installed, but the new one doesn't, you have a problem, as the encryption results between the two are different.
Make sure both PHP installations have the same libraries available.

That might be annoying to you, but it's your responsability that the platforms are equal.
You don't expect things to "just work" if you move from one environment to another without checking the prerequisites do you?[/quote]

Yes I guess you are right.

You know, it's actually more worrying than annoying.
My biggest concern is that the same mcrypt library might behave differently on different server environments that I won't be able to decode my data at all.

WanWizard, if I may ask further, do you use the encryption method from Codeigniter or something else?

Thank you so much for the help.
#4

[eluser]WanWizard[/eluser]
That is something you don't have to worry about.

The mycrypt API is defined, and is consistent across platform. Als long as you select the same encryption method offcourse, but that is no issue here, the code remains the same.

I use a modified version of CI's encryption library. The default library does XOR encoding/decoding by default, and adds mcrypt encoding/decoding if present. Since mcrypt is using strong encoding, I don't use the XOR functions if mcrypt is available. This speeds up the encryption tremendously, as XOR encryption in software (PHP code) is terribly slow.
#5

[eluser]josen[/eluser]
[quote author="WanWizard" date="1283363436"]That is something you don't have to worry about.

The mycrypt API is defined, and is consistent across platform. Als long as you select the same encryption method offcourse, but that is no issue here, the code remains the same.

I use a modified version of CI's encryption library. The default library does XOR encoding/decoding by default, and adds mcrypt encoding/decoding if present. Since mcrypt is using strong encoding, I don't use the XOR functions if mcrypt is available. This speeds up the encryption tremendously, as XOR encryption in software (PHP code) is terribly slow.[/quote]

Thank you for the explanation.
I really appreciate it.




Theme © iAndrew 2016 - Forum software by © MyBB