Using codeigniter encryption and decryption libraries with custom keys examples
Rabu, 07 Agustus 2019
Add Comment
![]() |
encryption |
yusri.irfani.blogspot.com - Using codeigniter encryption and decryption libraries with custom keys examples.
codeigniter encryption example
1. find and edit file : application/config/config.php
2. search this line :
$config['encryption_key'] = '';
Add the encryption key with whatever you want. Here just example:
$config['encryption_key'] = 'mykey';
3. create file MY_Encryption.php in application/libraries. Add with these code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Encryption extends CI_Encryption {
function encrypt($data, array $params = NULL) {
$ret = parent::encrypt($data, $params =array());
$ret = strtr($ret, array('+' => '.', '=' => '-', '/' => '~'));
return $ret;
}
function decrypt($data, array $params = NULL) {
$string = strtr($data, array('.' => '+', '-' => '=', '~' => '/'));
return parent::decrypt($string, $params=array());
}
} ?>
0 Response to "Using codeigniter encryption and decryption libraries with custom keys examples"
Posting Komentar