CodeIgniter Forums
Encrypt in CI, decrypt in Python - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Encrypt in CI, decrypt in Python (/showthread.php?tid=63852)



Encrypt in CI, decrypt in Python - Sentro - 12-15-2015

Hello,

I've been struggling with these the past day. I'm encrypting some passwords in CI using an encryption key. What i want is to be able to decrypt those and get the original passwords from python. I've found a library but i really couldn't get it to work ( and since it's latest update was 3 years ago i'm starting to think i lost my time too there ). Library is HERE
Anyway i was hoping maybe if there's someone that has something similar to this at least to get me started.
I did an echo of the params the encryption library is using. I can always change those if required but i'd prefer not to.

PHP Code:
testpassword
ce3399bb4cf3dc5a679c7f265a054808
Array
(
    [
handle] => aes-128-cbc
    
[cipher] => aes-128
    
[mode] => cbc
    
[key] => ���cݨe��Y\T�H�iw��ݷK1�vj4�
    [
base64] => 1
    
[hmac_digest] => sha512
    
[hmac_key] => 
)

openssl

f8448532d1261fd80e5782378b98dc3a5edb80b8caf5f5a4d935d6999f8726d6e84205467d846a77ac1f8a7c872e3ed3a61668daa3971b2aa75399b29f837d04MLPxAyGjS0wD5yuHcRCxCBAomPkuv63UBlHPJW2u
+4I


I know by default it's using aes-256 and mcrypt but played around them too and got nothing.
Also i started using the
PHP Code:
$config['encryption_key'] = hex2bin('ce3399bb4cf3dc5a679c7f265a054808'); 
version of my key, thought maybe the issue was there so i switched to to none bin but still nothing.

ANY help is appreciated.

Thank you


RE: Encrypt in CI, decrypt in Python - arma7x - 12-15-2015

Don't encrypts password using CI Encryption Library.