Код: Выделить всё
private function encryptApiCode($token, $cipher)
{
$tag = '';
return openssl_encrypt($token, 'aes-256-gcm', $cipher, 0, 'xxxxxxxxxxxxxxxx', $tag);
}
Код: Выделить всё
openssl_decrypt(encryptApiCode($token, $cipher), 'aes-256-gcm', $cipher, 0, 'xxxxxxxxxxxxxxxx', $tag);
Код: Выделить всё
$data = [
...,
'code' => encryptApiCode($token, $cipher),
...
];
$this->tableGateway->update($data, ['id' => $id]);
Код: Выделить всё
$rowset = $this->tableGateway->select($data)->toArray();
Код: Выделить всё
openssl_decrypt($dataFromDb, 'aes-256-gcm', $cipher, 0, 'xxxxxxxxxxxxxxxx', $tag);
Код: Выделить всё
error:0480006C:PEM routines::no start line
Подробнее здесь: https://stackoverflow.com/questions/790 ... from-mysql
Мобильная версия