This file contains hidden or 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
| import json | |
| import Crypto.Cipher.DES as DES | |
| import struct | |
| from Crypto.Util.number import * | |
| # Extended Greatest Common Divisor | |
| def egcd(a, b): | |
| if (a == 0): | |
| return [b, 0, 1] | |
| else: |
This file contains hidden or 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
| secret = "3ed2e01c1d1248125c67ac637384a22d997d9369c74c82abba4cc3b1bfc65f026c957ff0feef61b161cfe3373c2d9b905639aa3688659566d9acc93bb72080f7e5ebd643808a0e50e1fc3d16246afcf688dfedf02ad4ae84fd92c5c53bbd98f08b21d838a3261874c4ee3ce8fbcb96628d5706499dd985ec0c13573eeee03766f7010a867edfed92c33233b17a9730eb4a82a6db51fa6124bfc48ef99d669e21740d12656f597e691bbcbaa67abe1a09f02afc37140b167533c7536ab2ecd4ed37572fc9154d23aa7d8c92b84b774702632ed2737a569e4dfbe01338fcbb2a77ddd6990ce169bb4f48e1ca96d30eced23b6fe5b875ca6481056848be0fbc26bcbffdfe966da4221103408f459ec1ef12c72068bc1b96df045d3fa12cc2a9dcd162ffdf876b3bc3a3ed2373559bcbe3f470a8c695bf54796bfe471cd34b463e9876212df912deef882b657954d7dada47" | |
| secret = secret.decode("hex") | |
| f = open("value_md5.txt", "r") | |
| # head value_md5.txt | |
| # 00000000000000000000000000000000997d9369c74c82abba4cc3b1bfc65f02,aa85a4e0adbd34c287af2d20da4453c9 | |
| # 0000000000000000000000000000d903997d9369c74c82abba4cc3b1bfc65f02,9f5b543c64d3e384078fdd8cf4b2ce6d | |
| # 00000000000000000000000000efd802997d9369c74c82abba4cc3b |
This file contains hidden or 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
| # python rsatool.py -p 0x00e4ddba96c1cbc4f41204ee6fc16e14830438aeee4bbd21af5ce88dfd25a12f2a9a26994eefa0e6bed04ac2e29bf639b4c8f975ad886f3115ec5e384cc68c1fd7d7db63cc63f6346152809c71d226223d7d6990cae64dfc16f174fa1a6ee46b25afaffcf3936a61d3f2c69d6cee994feff8f2f0a70638420110d303d075ab16d3 -q 0x00dee55998947bfdb75c7e349bc76a1673a8c41b62929c242c0e3d0c808738972518f8639304b3340d6a88510cc524e37963a42d0638f605572aa7b93eda07dc29457118fa9a990062f05d0025d5467d3edf8db448cf12ed4ab67967be70c2a5617b3085d0e151357d63b1eca4b53746fcbe586cdc8a4405cfaf719f3f011318db -o test.key | |
| Using (p, q) to initialise RSA instance | |
| n = | |
| c7455240232e4c309b7afda495ccd5ff4a9cd78e945d76c6713955e12a5da435cdf967bd011d643b | |
| 3d417797075f8def866a8cb9f02745acbe78c4920b15dc36365f6c1dd71c9b900bc702a2f21c00e6 | |
| 711446857236b5c31106e4c1d3ee5bd7c785342aadb6a7d176df7edcb7ce1d78dfe992857e1a3473 | |
| 0756186ca4c200dec2a97f33b36c789fd7bb5866fbd68e83d823eae64c9e2d740f2f09d0383b39d5 | |
| 1aaeb190858e8a3b6ad9cbab8d935aa1bd01d1cbba238af4df8455d7d789c71ee6091f711e766f63 | |
| 3a0420f530adb7 |
This file contains hidden or 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
| -----BEGIN RSA PRIVATE KEY----- | |
| MIIEoQIBAAKCAQEAyOP3yjHxOk0I3NPJ4Q1HDvJmqAoxEdLMaNCiLxkVNSZwLTPMXnuoZikVznds | |
| OZ9t2bAe4P/9L1Pfg+35jfmxe96Jzk6dAXiuFmFlaOsKl4yBxRat6Far/UjBM9A2ZJgmYxWJJr3T | |
| MahpzZMWFbSD64QQYSBgPlX671xc4Q75omY0dfcANyPGYuTgTR9zmNyfk5s3e7yfYS9gZ+aU4Hmo | |
| x4NgKypw7OHVAN5hTZ0V2B3pGR9c6VoReHiOXXOEKD8QZbD6LMyuVO6K+cEklW562sh0CJo9qn8+ | |
| FT1tG6kC7d1tU3tptY/MA5uUhLGDW34WfXtgE42eIR01Ovi+hzC82wIDAQABAoIBAEiIv1xbQf1J | |
| +Uw6kCbZM3H7JgPAgk0sLrAdvKGCzfx9330CueTXg0s3xG7jAcmgffpetBeLdnBTOV4aW8Pehy3x | |
| gRJjoh744uqjygji7NUhX225LZu5R6pRTakWob0ajqmyCe5aFdpVM7aNSCkYH5W2/m8DUJzRUKSC | |
| VerRDGONHRCnNxV3w9u3EkdI5fvrOpY1TSqCmEZwCCPO+WfqIn8Ut/xNvHkNSXA2+h1KgmwyQQZ/ | |
| ZgsNeRa2+vZh2kgm3f1xccjQvyAel3t+5s0cPo0NI7qqHkiHNb6/yWR9AH+bGVXQc+VtR7GwisRZ |
This file contains hidden or 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
| import socket | |
| import string | |
| import time | |
| flag_len = 23 | |
| remoteip = "boxesofballots.pwn.republican" | |
| remoteport = 9001 | |
| charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_{}" |
This file contains hidden or 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
| # filename: solver.sage | |
| #f = open("intercepted", "r") | |
| # | |
| #f.readline() | |
| # | |
| #for line in f: | |
| # d, n, c = map(int, line.strip()[1:-1].split(":")) | |
| # print d, n, c | |
| # |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| def egcd(m, n): | |
| if n>0: | |
| y,x,d = egcd(n, m%n) | |
| return x, y-m/n*x, d | |
| else: | |
| return 1, 0, m | |
This file contains hidden or 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
| a = 1234577 | |
| b = 3213242 | |
| M = 7654319 | |
| def add(A,B): | |
| if A==(0,0): return B | |
| if B==(0,0): return A | |
| x1,y1 = A | |
| x2,y2 = B |
This file contains hidden or 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
| import sys | |
| import hashlib | |
| from AESCipher import * | |
| import string | |
| import itertools | |
| class SecureEncryption(object): | |
| def __init__(self, keys): | |
| #assert len(keys) == 4 | |
| self.keys = keys |