Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View huyinghuan's full-sized avatar
🤑
working

L.T huyinghuan

🤑
working
View GitHub Profile
@huyinghuan
huyinghuan / aes.go
Created September 5, 2018 00:49 — forked from willshiao/aes.go
AES 256-CFB in Node.js and Golang
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@huyinghuan
huyinghuan / crypt.js
Created May 31, 2017 02:00 — forked from esamson33/crypt.js
Node.js script to encrypt and decrypt an arbitrary string using 128-bit AES method in CFB mode
/*!
* Node.js script to encrypt and decrypt an arbitrary string using
* 128-bit AES method in CFB mode.
*
*/
// A 16-byte key is required for a 128-bit encryption
var crypto = require('crypto'),
key = new Buffer('sixteen byte key'),
iv = crypto.randomBytes(16),