load->library('encryption'); $this->encryption->initialize( array( 'cipher' => 'aes-256', 'mode' => 'ctr', 'key' => '2UFdhHgY5n5Smd5RnD3H8Z6rKJ8j3zra' ) ); $ciphertext = $this->encryption->encrypt('ctnews^L3wvaMt8GLAatZLE.T' . base64_encode(time())); $this->output ->set_content_type('application/json') ->set_output(json_encode(['token' => $ciphertext])); } }