Created
May 21, 2009 14:01
-
-
Save andrewgilmartin/115478 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( substitution_cipher_grid ) { | |
var substitution_cipher={}; | |
var rows = substitution_cipher_grid.split("."); | |
for ( var r = 0; r < rows.length; r++ ) { | |
var cells = rows[r].strip().split( /\s+/ ); | |
for ( var c = 0; c < cells.length; c++ ) { | |
substitution_cipher[cells[c]]=c+1 | |
} | |
} | |
var domain = window.location.host.split('.').reverse().splice(0,2).reverse().join('.'); | |
var password=domain.split("").map( function(c) { return substitution_cipher[c] || 0; } ).join(''); | |
window.prompt( "Password for "+domain+" is:", password ); | |
} ) ( " a b c d e f . \ | |
g h i j k l . \ | |
m n o p q r . \ | |
s t u v w x " ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment