Skip to content

Instantly share code, notes, and snippets.

View androrim's full-sized avatar
🏠
Working from home

Leandro de Amorim androrim

🏠
Working from home
View GitHub Profile
@joashp
joashp / openssl_encrypt_decrypt.php
Created September 4, 2015 15:59
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
*/