Skip to content

Instantly share code, notes, and snippets.

View dieison's full-sized avatar
🎯
Focusing

Dieison Rabêlo dieison

🎯
Focusing
View GitHub Profile
@dieison
dieison / openssl_encrypt_decrypt.php
Created October 1, 2019 23:51 — 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
*/
@dieison
dieison / AesCipher.java
Created October 3, 2019 23:12 — forked from demisang/AesCipher.java
AES/CBC/PKCS5Padding encrypt/decrypt PHP and JAVA example classes
import android.support.annotation.Nullable;
import android.util.Base64;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;