Код: Выделить всё
export const encrypt = (data, key) => {
const encrypted = CryptoJS.AES.encrypt(
JSON.stringify(data),
key
).toString();
return encrypted;
};
Код: Выделить всё
Route::post('/decrypt', function (Request $request) {
try{
$encrypted = $request->input("data");
Crypt::decrypt($encrypted);
}
catch(DecryptException $e) {
dd("error", $e);
}
});
Подробнее здесь: https://stackoverflow.com/questions/787 ... in-laravel
Мобильная версия