Skip to content

Instantly share code, notes, and snippets.

View ledunguit's full-sized avatar

ZeD ledunguit

  • LD
View GitHub Profile
@ledunguit
ledunguit / aes_enc_dec.php
Created August 21, 2021 13:27 — forked from turret-io/aes_enc_dec.php
AES encryption/decryption in PHP
<?php
// DEFINE our cipher
define('AES_256_CBC', 'aes-256-cbc');
// Generate a 256-bit encryption key
// This should be stored somewhere instead of recreating it each time
$encryption_key = openssl_random_pseudo_bytes(32);
// Generate an initialization vector
// This *MUST* be available for decryption as well
@ledunguit
ledunguit / AES.cs
Created August 21, 2021 13:25 — forked from mhingston/AES.cs
AES-256-CBC for C# and Node
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
class AES
{
public static string Encrypt(string plainText, string keyString)
{
byte[] cipherData;