Skip to content

Instantly share code, notes, and snippets.

View AIMAGU's full-sized avatar
💭
I may be slow to respond.

Nur Rochim AIMAGU

💭
I may be slow to respond.
View GitHub Profile
@AIMAGU
AIMAGU / openssl_encrypt_decrypt.php
Created July 25, 2019 09:08 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/