codi

In CodeIgniter , I will learn to how to use encryption library in CodeIgniter and where you can use encryption library .

Why we use the encryption library in CodeIgniter?

I can explain encryption library in very way. If you want to send a message and you want no one can read message only authorize person only need than we will use encryption library to encrypt message and send to another person.

How can we use the encryption library in CodeIgniter?

In CodeIgniter first you will need initial encrypt library.you will below this code.
$this->load->library(‘encrypt’); // class create
$this->encrypt // create object of class

You will also create encryption_key in this file application/config/config.php
$config[‘encryption_key’] = “YOUR KEY”;

$this->encrypt ($string ,$key);

How to encrypt message in CodeIgniter?

Use below method to load liberary

$this->encrypt->encode()
$message=’Hello This is test message’;
$encrypted_string = $this->encrypt->encode($msg, $key);

How to decrypt message in CodeIgniter?

$this->encrypt->decode()

$encryp_string = ‘dsfsdfsdfsdfsd43543543GZl8pdwwa84’;
$plaintext_string = $this->encrypt->decode($encryp_string);

[social_share_button themes='theme1']

Leave a Comment