Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
27
homestead/application/controllers/KeyController.php
Normal file
27
homestead/application/controllers/KeyController.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class KeyController extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->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]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user