3
votes

I am currently trying to import a user list from a previous database that has encrypted passwords using codeIgniter's Mcrypt protocol.

Quite frankly, I have no idea what I'm doing :( I've installed the framework on my server, and have attempted to call the decrypt class from the framework, and it's simply not taking.

My objective is to decrypt the passwords and encrypt them into Joomla's (what I think is used, at least) md5 encrypted and salted passwords. Here is an example of a password that I need to be decrypted:

r5WEX++ZKggg7d6fQYAZfFOm/z3nTJmxQA00zVWhhn7cvmrSrIm/NYI51o9372qf6JtYQEil72b4JzszVo+oPg==

I think I can handle the re-encryption, I just have no idea how to decrypt these things. Thank you to anyone that can help!

1
if it is encrypted using MD5 and Salt , it is One Way Encryption or better to say hashing ! You can't Decrypt it !Mehdi Maghrouni
@MehdiMaghrooni Thank you for the reply...I was starting to suspect as such. If that is the case, is there any way to convert it without decrypting it?Russ Toms

1 Answers

5
votes

Codeigniter by default uses $config['encryption_key'] which you can find it in config file, for cryptographic process !

so for decrypting it , you have to first have this key ! then you can decrypt it as follows :

$this->load->library('encrypt');

$encrypted_password = 'r5WEX++ZKggg7d6fQYAZfFOm/z3nTJmxQA00zVWhhn7cvmrSrIm/NYI51o9372qf6JtYQEil72b4JzszVo+oPg==';
$key = 'secret-key-in-config';

$decrypted_string = $this->encrypt->decode($encrypted_password, $key);

and after that you can encrypt it again !