Skip to content

Instantly share code, notes, and snippets.

Avatar

Authmane Terki authmane512

View GitHub Profile
View decryption.js
const nacl = require('tweetnacl');
const util = require('tweetnacl-util');
const scrypt = require('scryptsy');
const fs = require('fs');
let password = "Node.js is cool";
// these are our previous salt and nonce from encryption.js:
let salt = new Uint8Array([ 232, 66, 12, 24, 90, 175, 58, 106, 13, 220, 241, 77, 156, 230, 140, 218 ]);
let nonce = new Uint8Array([ 143, 28, 216, 227, 2, 177, 160, 159, 243, 180, 138, 230, 142, 165, 28, 189, 208, 63, 130, 131, 204, 240, 105, 142 ]);
View encryption.js
const nacl = require('tweetnacl');
const util = require('tweetnacl-util');
const scrypt = require('scryptsy');
const fs = require('fs');
let password = "Node.js is cool";
let secret_msg = util.decodeUTF8("NPM is amazing!"); // function should be named "encodeUTF8", they reversed names!
// Generate the key:
let salt = nacl.randomBytes(16);
@authmane512
authmane512 / encryption.py
Created Oct 26, 2018
How to securely encrypt data in Python with NaCl library
View encryption.py
import nacl.secret
import nacl.utils
import nacl.pwhash
# Do not do "import nacl", it won't work
import base64
password = b"I like Python"
secret_msg = b"Actually, I prefer Javascript..."
# Generate the key:
@authmane512
authmane512 / decryption.py
Last active Oct 26, 2018
How to securely decrypt data in Python with NaCl library
View decryption.py
import nacl.secret
import nacl.utils
import nacl.pwhash
import base64
password = b"I like Python"
salt = b'3\xba\x8f\r]\x1c\xcbOsU\x12\xb6\x9c(\xcb\x94' # our previous salt from encryption.py:
# https://gist.github.com/authmane512/7f0c1d6797ea9ff83015c3ddce704b3a
# Generate the key:
View squid.conf
# port of proxy
http_port 5000
# hostname of proxy
visible_hostname SuperProxy
# IP header HTTP masking (X-Forwarded-For: unknown)
forwarded_for off
# logs
View squid.conf
# port of proxy
http_port 5000
# hostname of proxy
visible_hostname SuperProxy
# IP header HTTP masking (X-Forwarded-For: unknown)
forwarded_for off
# logs
View fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# root
UUID=<UUID> / ext4 errors=remount-ro 0 1
View MainActivity.java
package com.example.javamailapp;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.os.Bundle;
import android.widget.*;
import javax.mail.MessagingException;
import javax.mail.Session;
View build.sh
#!/bin/bash
set -e
AAPT="/path/to/android-sdk/build-tools/23.0.3/aapt"
DX="/path/to/android-sdk/build-tools/23.0.3/dx"
ZIPALIGN="/path/to/android-sdk/build-tools/23.0.3/zipalign"
APKSIGNER="/path/to/android-sdk/build-tools/26.0.1/apksigner" # /!\ version 26
PLATFORM="/path/to/android-sdk/platforms/android-19/android.jar"
You can’t perform that action at this time.