CodeIgniter Forums
Encrypt Class Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Encrypt Class Problem (/showthread.php?tid=18689)



Encrypt Class Problem - El Forum - 05-14-2009

[eluser]Deep Arora[/eluser]
I am using CI's encrypt library to encrypt a part of the URL.

Now after encrypting, I form the URL and email it to user. This is a URL that user can click to unsubscribe from the emails.

Now, after encryption, it adds "/" slash multiple times as part of its encryption. So the string outputs as:

Fa29uf1B4yPTKiy3EVMC4xhYMyVy2s1lMfNNK/PjnJgN2Vf0ivQxB5ZBVadyFf6QQt33Co6emVQduqGsv3vM6jndN5C08l7swKWrI/FEEH3nUMU3Tc0Zen3UauVkCaaa

As you can see there are THREE instances of / in the above string.

The URL becomes like this:

http://mydomain.com/process/remove/Fa29uf1B4yPTKiy3EVMC4xhYMyVy2s1lMfNNK/PjnJgN2Vf0ivQxB5ZBVadyFf6QQt33Co6emVQduqGsv3vM6jndN5C08l7swKWrI/FEEH3nUMU3Tc0Zen3UauVkCaaa

But when I rceeive this parameter in my REMOVE function i controller PROCESS, it receives the value only upto first instance of "/"

Only this part of string is received: Fa29uf1B4yPTKiy3EVMC4xhYMyVy2s1lMfNNK

How can I ensure that I receive FULL string to decrypt?

Regds,
Deep


Encrypt Class Problem - El Forum - 05-14-2009

[eluser]Unknown[/eluser]
use $this->uri->total_segments()
and a loop using $this->uri->segment(n) to pull all the segments and reassemble them.

see Uri class for more info

or make it so there are no / in the encrypted string


Encrypt Class Problem - El Forum - 05-14-2009

[eluser]Deep Arora[/eluser]
Is there a way to ensure that no / gets added to the encrypted string?


Encrypt Class Problem - El Forum - 05-12-2011

[eluser]Zair[/eluser]
To avoid / issue you can use this

urlencode($this->encrypt->encode('abc'));

and at the other end you can decrypt it by using :

$this->encrypt->decode->(urldecode($this->uri->segment(3));

hope this will solve the issue... Smile


Encrypt Class Problem - El Forum - 05-12-2011

[eluser]InsiteFX[/eluser]
string stripslashes ( string $str )

InsiteFX


Encrypt Class Problem - El Forum - 08-17-2011

[eluser]chamil sanjeewa[/eluser]
thanx Zair


Encrypt Class Problem - El Forum - 08-17-2011

[eluser]DM613[/eluser]
thanks for sharing it with us,we appreciate it very much ,you are so kindly,we will go on look your post ,welcome more new information from you ,thanks again.

I have the same opinion as you ,I think your words is reasonable and meaningful.


Encrypt Class Problem - El Forum - 08-18-2011

[eluser]pooja[/eluser]
Hello....

Thank you for the answer.....

iphone Application development

pooja

KryptonSoft