In this article, we will see how to encrypt and decrypt strings in laravel 9. As we all know laravel framework provides more security to the user and that's why laravel provide encrypt of password or string to the user, here we will see encrypt or decrypt a string in laravel 9. Laravel's encryption services provide a simple, convenient interface for encrypting and decrypting text via OpenSSL using AES-256 and AES-128 encryption. So, let's see encrypt decrypt a string in laravel 9, laravel 9 in encrypt a string, laravel 9 in decrypt string.

Example 1: password = Crypt::encrypt($data['password']); $user->save(); try { $decrypted = Crypt::decrypt($row->password);; } catch (DecryptException $e) { $e->getMessage(); info("Error....!!"); }}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners