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
require 'msf/core' | |
require 'crypt/blowfish' # sorry, openssl is limited to 16-byte key size :( | |
# add gem 'crypt', '1.1.4' to Gemfile | |
module ::Crypt | |
class Blowfish | |
def setup_blowfish() | |
@sBoxes = Array.new(4) { |i| INITIALSBOXES[i].clone } | |
@pArray = INITIALPARRAY.clone | |
keypos = 0 |
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
from collections import defaultdict | |
def isUnique(string): | |
seen = defaultdict(lambda: False) | |
for x in string: | |
if not seen[x]: seen[x] = True | |
else: return False | |
return True |
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
def fib(n): | |
return reduce(lambda x, y: [x[1], x[0] + x[1]], xrange(n-2), [0, 1])[1] |
NewerOlder