Welcome Guest, Not a member yet? Register   Sign In
Encrypted String Changes Every Time (very bad!)
#2

[eluser]Chris Newton[/eluser]
As long as it decodes, then it's fine, it's doing its job. I've tested it as well, and the string may be different every time, but the decode works. That's the nice thing about working with frameworks, some things are 'black boxes' that you plug data into and get out the results without needing to know what's under the hood. In this case, just use the CI decrypt function, and you'll get your data back out safe & sound.


Here's some test code;

Code:
<?php
class Encrypt extends Controller{
    function Encrypt(){
        parent::Controller();
    }
    function index(){
    $this->load->library('encrypt');
    $msg = 'My secret message';
$encrypted_string = $this->encrypt->encode($msg);
echo 'encrypted: '.$encrypted_string;
echo '<br />';
echo '<br />';
$decrypted_string=$this->encrypt->decode($encrypted_string);

echo 'decrypted: '.$decrypted_string;
    }
}
?&gt;


Messages In This Thread
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 01:08 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 01:29 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 01:50 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 02:23 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 07:38 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 08:10 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 08:12 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 08:25 PM
Encrypted String Changes Every Time (very bad!) - by El Forum - 11-17-2007, 08:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB