Skip to content

Instantly share code, notes, and snippets.

View jcspencer's full-sized avatar

James Spencer jcspencer

  • Australia
View GitHub Profile
@jcspencer
jcspencer / graph.js
Created January 3, 2014 00:12
Redis social graph in node.js, with following and blocking
var redis = require('redis').createClient(),
f = require('util').format;
Array.prototype.diff = function(a) { // use to remove blocked users
return this.filter(function(i) {return !(a.indexOf(i) > -1);});
};
var methods = {
follow: function(a, b, cb) {
db.sadd(f("node:%s:following", a), b, function(err, res){
@hubert3
hubert3 / samsung_hash_crack.py
Last active November 22, 2022 09:12
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
#!/usr/bin/python
'''
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
Correct PIN for hash and salt below is 1234.
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db