https://github.com/mazfreelance/yii2-laravel-crypt
encrypt and decrypt function for yii2 and compatible to use in laravel.
https://github.com/mazfreelance/yii2-laravel-crypt
decryption encryption encryption-decryption laravel yii2-advanced yii2-extension yii2-framework
Last synced: 4 months ago
JSON representation
encrypt and decrypt function for yii2 and compatible to use in laravel.
- Host: GitHub
- URL: https://github.com/mazfreelance/yii2-laravel-crypt
- Owner: mazfreelance
- Archived: true
- Fork: true (xwei3752/yii2-laravel-crypt)
- Created: 2021-11-16T03:15:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-08T10:41:14.000Z (over 3 years ago)
- Last Synced: 2024-09-23T22:03:09.833Z (8 months ago)
- Topics: decryption, encryption, encryption-decryption, laravel, yii2-advanced, yii2-extension, yii2-framework
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Yii2 Laravel Cryption
this is same as laravel(>=5.1) encrypt and decrypt function.## Changelog
For changes since the last version see the [Changelog](https://github.com/mazfreelance/yii2-laravel-crypt/blob/master/CHANGELOG.md).## Installation
```
composer require mazfreelance/yii2-laravel-crypt -W
```## Config
add your params local
```
'encrypter' => [
'key' = '',
'cipher' = ''
]
```## Usage:
#### 1) single use OR
```
use Cryption\Encrypter;$cryption = Encrypter("yourRandomString","AES-256-CBC");
$cryption->encrypt("yourData");`
```
#### 2) this Behavior is used to encrypt data before storing it on the database and to decrypt it upon retrieval.
- add the following code on Model class
```
public function behaviors()
{
return [
'encryption' => [
'class' => '\Cryption\EncryptionBehavior',
'attributes' => [
'attribute1',
'attribute2',
],
],
];
}
```