Encryption in Codeigniter



Encryption is the fucntion that convert your string or array into unreadable format
For example :

String = Hello Guidephp

Encryption format = RMWxKXaJR1w6BFDzGRIJjr9eVs8ygZJLqMqvhXPkiJQ=

To Make security and avoid attack on your data by hackers. its unable to decrypt the string to hackers. they dont know about the what the encryption data consist of , what is data in encryption string.

Benefits of Encryption
1. Data Integrity
2. Data Protection
3. Data Confidentiality
4. Secure
5. Easy to use

We can define Encryption Algorithm according to our requirement. one must have more experince about encryption decryption. we can create Encyption library and load in library then use it in functions where ever you need to use encryption.

I have created Encryption Libarary, below i show you how i encrypt string

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

$str = "Hello Guidephp";

$json_data=json_encode($str);

$encoded_string =$this->encrypt->base64_url_encode($json_data);


output : BjThQQ1QS7UD8IxujjJX2dLy9cus71aOuPAkBYz/fQ0=









Encryption in Codeigniter Encryption in Codeigniter Reviewed by Admin on April 29, 2020 Rating: 5

No comments:

Powered by Blogger.