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 decrypt_and_compare(data, key, iv, expected): | |
unpad = lambda s: s[0:-ord(s[-1])] | |
aes = Crypto.Cipher.AES.new(key, Crypto.Cipher.AES.MODE_CBC, iv) | |
# Decrypt each block of data, except for the last one | |
for i in xrange(0, len(data) - 16, 16): | |
if aes.decrypt(data[i:i+16]) != expected[i:i+16]: | |
return False | |
# Decrypt the last block of data, unpad, and compare |
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
# for http://www.reddit.com/r/codes/comments/3874s7/crack_this_old_code_for_shiny_gold/ | |
# this is from source to InfoLock 5.5, http://sourceforge.net/projects/infolock | |
encoder_ring = { | |
'a': 8, 'b': 2, 'c': 3, 'd': 4, 'e': 7, 'f': 19, 'g': 5, 'h': 1, 'i': 9, | |
'j': 10, 'k': 29, 'l': 12, 'm': 24, 'n': 14, 'o': 15, 'p': 16, 'q': 25, | |
'r': 18, 's': 6, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 13, 'y': 17, | |
'z': 26, '!': 11, '?': 30, 'A': 31, 'B': 32, 'C': 33, 'D': 34, 'E': 35, | |
'F': 36, 'G': 37, 'H': 38, 'I': 39, 'J': 40, 'K': 41, 'L': 42, 'M': 43, | |
'N': 44, 'O': 45, 'P': 46, 'Q': 47, 'R': 48, 'S': 49, 'T': 50, 'U': 51, | |
'V': 52, 'W': 53, 'X': 54, 'Y': 55, 'Z': 56, ',': 57, '\'': 58, ':': 59, |
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
diff --git a/Makefile b/Makefile | |
index ceb9d77..c9bd8fd 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -60,7 +60,7 @@ SOMINOR=1 | |
SORELEASE?=.0# Declare empty to leave out from library file name. | |
MINISAT_CXXFLAGS = -I. -D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -Wall -Wno-parentheses -Wextra | |
-MINISAT_LDFLAGS = -Wall -lz | |
+MINISAT_LDFLAGS = -Wall |
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
diff --git a/CMakeLists.txt b/CMakeLists.txt | |
index 27fd96f..1cc8f01 100644 | |
--- a/CMakeLists.txt | |
+++ b/CMakeLists.txt | |
@@ -320,14 +320,6 @@ endif() | |
# ----------------------------------------------------------------------------- | |
# Find Minisat | |
# ----------------------------------------------------------------------------- | |
-find_package(minisat) | |
-set(MINISAT_INCLUDE_DIRS "" CACHE PATH "MiniSat include directory") |
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 sys import stdout, stderr | |
# Enable tab completion if readline is available. Rather than using the | |
# default completer, though, we allow tabs at the beginning of the line. | |
try: | |
import readline | |
readline.is_libedit = 'libedit' in readline.__doc__ | |
except ImportError: | |
pass | |
else: |
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
AAABAACAADAAEAAFAAGAAHAAIAAJAAKAALAAMAANAAOAAPAAQAARAASAATAAUAAVAAWAAXAAYAAZABABBABCABDABEABFABGABHABIABJABKABLABMABNABOABPABQABRABSABTABUABVABWABXABYABZACACBACCACDACEACFACGACHACIACJACKACLACMACNACOACPACQACRACSACTACUACVACWACXACYACZADADBADCADDADEADFADGADHADIADJADKADLADMADNADOADPADQADRADSADTADUADVADWADXADYADZAEAEBAECAEDAEEAEFAEGAEHAEIAEJAEKAELAEMAENAEOAEPAEQAERAESAETAEUAEVAEWAEXAEYAEZAFAFBAFCAFDAFEAFFAFGAFHAFIAFJAFKAFLAFMAFNAFOAFPAFQAFRAFSAFTAFUAFVAFWAFXAFYAFZAGAGBAGCAGDAGEAGFAGGAGHAGIAGJAGKAGLAGMAGNAGOAGPAGQAGRAGSAGTAGUAGVAGWAGXAGYAGZAHAHBAHCAHDAHEAHFAHGAHHAHIAHJAHKAHLAHMAHNAHOAHPAHQAHRAHSAHTAHUAHVAHWAHXAHYAHZAIAIBAICAIDAIEAIFAIGAIHAIIAIJAIKAILAIMAINAIOAIPAIQAIRAISAITAIUAIVAIWAIXAIYAIZAJAJBAJCAJDAJEAJFAJGAJHAJIAJJAJKAJLAJMAJNAJOAJPAJQAJRAJSAJTAJUAJVAJWAJXAJYAJZAKAKBAKCAKDAKEAKFAKGAKHAKIAKJAKKAKLAKMAKNAKOAKPAKQAKRAKSAKTAKUAKVAKWAKXAKYAKZALALBALCALDALEALFALGALHALIALJALKALLALMALNALOALPALQALRALSALTALUALVALWALXALYALZAMAMBAMCAMDAMEAMFAMGAMHAMIAMJAMKAMLAMMAMNAMOAMPAMQAMRAMSAMTAMUAMVAMWAMXAMYAMZANANBANCANDANEANFANGANHA |
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
#!/bin/bash -e | |
RIN="6601234567" | |
PIN="12180" | |
SIS="sis.rpi.edu" | |
# Options for curl(1), e.g., -vvv for verbose and -s for silent. | |
CURLOPTS="-s" | |
# Use HTTPS if it's available. |
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
#!/bin/bash -e | |
if [ "$1" = "store" ]; then | |
echo -n "Archiving Subversion metadata... " | |
find . -name '.svn' -type d -print0 > .svn.tmp | |
xargs -0 tar cf .svn.tar < .svn.tmp | |
xargs -0 rm -Rf < .svn.tmp | |
rm -f .svn.tmp | |
echo "done." | |
elif [ "$1" = "restore" ]; then |
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
(* Converts hex digits in big endian to an integer. *) | |
on fromHex(theDigits) | |
set theValue to 0 | |
repeat with theDigit in theDigits | |
set theValue to (theValue * 16) + (offset of theDigit in "0123456789ABCDEF") - 1 | |
end repeat | |
return theValue | |
end fromHex | |
(* Does a record have a certain key? (Hack.) *) |
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
# Cracker for David Lougheed's Ciphode 0.06, by rgov. | |
# See www.davidlougheed.com/ciphode for details. | |
''' | |
printable is a set of all of the characters that can be easily typed. We can | |
use it to test whether a numkey decrypts the message into gibberish or not. | |
''' | |
from string import printable | |
def isprintable(string): |
OlderNewer