Skip to content

Instantly share code, notes, and snippets.

def SQUFOF(N):
s = int( isqrt(N)+0.5)
if (s**2 == N):
return s
for k in range(0,len(multiplier)):
D = multiplier[k]*N
Po = Pprev = P = isqrt(D)
Qprev = 1
Q = D - Po**2
L = int(2 * isqrt(2*s))
@daedalus
daedalus / miller_rabin.py
Created August 31, 2020 20:33 — forked from Ayrx/miller_rabin.py
Python implementation of the Miller-Rabin Primality Test
def miller_rabin(n, k):
# Implementation uses the Miller-Rabin Primality Test
# The optimal number of rounds for this test is 40
# See http://stackoverflow.com/questions/6325576/how-many-iterations-of-rabin-miller-should-i-use-for-cryptographic-safe-primes
# for justification
# If number is even, it's a composite number
if n == 2:
@daedalus
daedalus / binary_polinomial_factoring.sage
Created February 25, 2020 19:07
Factoring integers representing them with polynomials with order=bits
#!/usr/bin/sage
# Factoring integers representing them with polynomials with order=bits
# Ex: 15 = 2^0 + 2^1 + 2^2 + 2^3 -> (2^0 + 2^1) * (2^0 + 2^2) -> 3*5
# It works well with mersenne primes but not with other composites.
# Author Dario Clavijo 2020
# GPlv3
import sys
sys.setrecursionlimit(100000)
@daedalus
daedalus / SECG-Curve-Seeds.txt
Created February 23, 2020 03:28 — forked from briansmith/SECG-Curve-Seeds.txt
SECG Curve Seeds
https://bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975
https://bitcointalk.org/index.php?topic=289795.msg3191346#msg3191346
https://bitcointalk.org/index.php?topic=289795.msg3200275#msg3200275
SECG 1.0: http://www.secg.org/SEC2-Ver-1.0.pdf
ASCII "MinghuaQu"
1. secp112r1 00F50B028E|4D696E676875615175|290472783FB1
2. secp112r2 002757A111|4D696E676875615175|5316C05E0BD4
----| |
3. secp128r1 000E0D|4D696E676875615175|0CC03A4473D03679
@daedalus
daedalus / break-short.c
Last active April 20, 2020 08:42
Program to brute force private keys from public keys using the baby-step giant-step algorithm. Improved to use threads.
/***********************************************************************************************************
* Copyright (c) 2017, Jochen Hoenicke
* Modified by: jpyao78 https://bitcointalk.org/index.php?topic=1306983.msg51542451#msg51542451
* *
* Compile with:
* gcc -O2 -I secp256k1/src/ -I secp256k1/ break_short.c -lgmp
* gcc -O2 -I secp256k1/src/ -I secp256k1/ break-short.c -lgmp -lpthread -o break-short -mcmodel=large
***********************************************************************************************************/
#include "libsecp256k1-config.h"
@daedalus
daedalus / netgear-private-key-disclosure.md
Created January 20, 2020 21:12 — forked from nstarke/netgear-private-key-disclosure.md
Netgear TLS Private Key Disclosure through Device Firmware Images

Netgear Signed TLS Cert Private Key Disclosure

Overview

There are at least two valid, signed TLS certificates that are bundled with publicly available Netgear device firmware.

These certificates are trusted by browsers on all platforms, but will surely be added to revocation lists shortly.

The firmware images that contained these certificates along with their private keys were publicly available for download through Netgear's support website, without authentication; thus anyone in the world could have retrieved these keys.

@daedalus
daedalus / heartbleed.py
Created November 30, 2019 00:02 — forked from eelsivart/heartbleed.py
Heartbleed (CVE-2014-0160) Test & Exploit Python Script
#!/usr/bin/python
# Modified by Travis Lee
# Last Updated: 4/21/14
# Version 1.16
#
# -changed output to display text only instead of hexdump and made it easier to read
# -added option to specify number of times to connect to server (to get more data)
# -added option to send STARTTLS command for use with SMTP/POP/IMAP/FTP/etc...
# -added option to specify an input file of multiple hosts, line delimited, with or without a port specified (host:port)
@daedalus
daedalus / ssltest.py
Created November 29, 2019 23:54 — forked from sh1n0b1/ssltest.py
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@daedalus
daedalus / ssh-fingerprints.csv
Created October 17, 2019 23:49 — forked from achillean/ssh-fingerprints.csv
Top 1,000 Duplicate SSH Fingerprints on the Internet
dc:14:de:8e:d7:c1:15:43:23:82:25:81:d2:59:e8:c0 245272
32:f9:38:a2:39:d0:c5:f5:ba:bd:b7:75:2b:00:f6:ab 197846
d0:db:8a:cb:74:c8:37:e4:9e:71:fc:7a:eb:d6:40:81 152046
34:47:0f:e9:1a:c2:eb:56:eb:cc:58:59:3a:02:80:b6 140777
df:17:d6:57:7a:37:00:7a:87:5e:4e:ed:2f:a3:d5:dd 91904
81:96:a6:8c:3a:75:f3:be:84:5e:cc:99:a7:ab:3e:d9 80499
7c:a8:25:21:13:a2:eb:00:a6:c1:76:ca:6b:48:6e:bf 78172
1c:1e:29:43:d2:0c:c1:75:40:05:30:03:d4:02:d7:9b 71851
8b:75:88:08:41:78:11:5b:49:68:11:42:64:12:6d:49 70786
c2:77:c8:c5:72:17:e2:5b:4f:a2:4e:e3:04:0c:35:c9 68654
From challenge-administrator@RSA.COM Sun Oct 12 09:36:34 1997
Received: from RSA.COM (chirality.rsa.com [192.80.211.33])
by shire.ontko.com (8.8.5/8.8.5) with SMTP id JAA17505
for ; Sun, 12 Oct 1997 09:36:33 -0500
Received: by RSA.COM
id AA20097; Sun, 12 Oct 97 06:29:28 PDT
Date: Sun, 12 Oct 97 06:29:28 PDT
Message-Id: <9710121329.AA20097@RSA.COM>
From: challenge-administrator@RSA.COM (RSA Factoring Challenge Administrator)
To: rayo@ontko.com