Skip to content

Instantly share code, notes, and snippets.

View AlainBartmanDilaw's full-sized avatar
Got this feeling in my body

Alain Léglise AlainBartmanDilaw

Got this feeling in my body
View GitHub Profile
@mhingston
mhingston / AES.cs
Last active September 10, 2024 23:16
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;
@matthewzring
matthewzring / markdown-text-101.md
Last active April 28, 2025 07:24
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@doncadavona
doncadavona / Aes256CbcEncrypterApp.cs
Last active November 21, 2024 18:38
A sample C# class to encrypt and decrypt strings using the cipher AES-256-CBC used in Laravel.
using System;
using System.Text;
using System.Security.Cryptography;
using System.Web.Script.Serialization;
using System.Collections.Generic;
namespace Aes256CbcEncrypterApp {
class MainClass {
public static void Main(string[] args) {
Console.WriteLine("Hello, world!");
@vlucas
vlucas / encryption.ts
Last active April 26, 2025 10:26
Stronger Encryption and Decryption in Node.js
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters)
const IV_LENGTH: number = 16; // For AES, this is always 16
/**
* Will generate valid encryption keys for use
* Not used in the code below, but generate one and store it in ENV for your own purposes
*/
export function keyGen() {