Welcome Guest, Not a member yet? Register   Sign In
Please Solve My Encryption problem..
#1

[eluser]anciwasim[/eluser]
Hi every one...thats very nice Community for support ...i belive...
i have on issue related to encryption class..same code working at my m/c on Wamp, but not working perfect at Dreamhost.com webserver

i have just encrypted a UserId controller and sending mail to client for activate account.
but when he is clicking ..on that link..that will not decoding in actual data..please solve this...

I have used key ...
UserId is auto numeber, BIGINT fields.like 1,2,3 and so on..
Code:
function sendActivationKey($userId){
    $encrypted_uid =$this->encrypt->encode($userId);
    $encrypted_uid =trim($encrypted_uid,'=');
    $this->load->library('email');
    $config['protocol'] = 'sendmail';
    $config['mailpath'] = '/usr/sbin/sendmail';
    $config['charset'] = 'iso-8859-1';
        $config['wordwrap'] = TRUE;
        $this->email->initialize($config);      
        $this->email->from("team mail", ' Team');                  
        $this->email->to($Email);          
        $this->email->subject('Activate your Account');
    $LinkSend=base_url()."mydomin/activate/".$encrypted_uid;// link send
    $this->email->message("Thank you ,please click on below link to activate your account \n ".$LinkSend);
    if($this->email->send()==1){
          return true;
        }

}
function activation(){
   $uid=$this->uri->segment(3);
   $userId=$this->encrypt->decode(uid]);  
   echo $userId;
}
Please solve my problem...Activation not again decoding correct value.

i have use trim function..for tralling "=" , which is coming after encoding a value.
#2

[eluser]Eric Barnes[/eluser]
From what I see:
mydomin/activate/".$encrypted_uid;

You should be using:
$uid=$this->uri->segment(2);

Instead of:
$uid=$this->uri->segment(3);
#3

[eluser]anciwasim[/eluser]
sorry that was my mistak its typed...
it is "mydomain/controller/activate/".$encode ,string

after A lots of try… detect the bug… now ... i want to solve this..bug..

Encrypted Link is .. wii1+SrOOA4ohiwqB0wVRQ+QkTFCOrocdxpm45UXmIU
also this is appering in URL. but when i am getthing this by $this->uri->segment(3);
its converted into .. wii1_SrOOA4ohiwqB0wVRQ_QkTFCOrocdxpm45UXmIU

so i used

srt_replace("_”,"+",$this->uri->segment(3));
and problem resolved...but next problem coming...that is now
encrypted key is generating
MptEkZQ4q/hoZTzXi6u2dpyTNb347uUcnh5eXPgAN
that… “ /” which is breaking segments
then again uri->segment(3) not getting full string…
how can i resolve this...that $this->encrypt->encode($string);
will not generate… +,_,/ or this type of other symbol..please help
#4

[eluser]Derek Allard[/eluser]
Please don't double post. I'm closing this thread, and discussion can continue in the other one.




Theme © iAndrew 2016 - Forum software by © MyBB