Skip to content

Instantly share code, notes, and snippets.

View AukeTembrink's full-sized avatar
:shipit:

Auke Tembrink AukeTembrink

:shipit:
View GitHub Profile
@AukeTembrink
AukeTembrink / index.js
Created March 31, 2017 12:16
Textverschlüsselung mit crypto
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'ThisIsAUserPassword';
function encrypt(text){
var cipher = crypto.createCipher(algorithm, password)
var crypted = cipher.update(text, 'utf8', 'hex')
crypted += cipher.final('hex');
return crypted;
}