andrewbluepiano / quickscripts-crypto

Scripts to do the math for my homework. Some were actual homework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yep

Just scripts to keep me from having to do math
Generally they all display nicely. (Pretty Print)

affinedecryptor

Feed it a string, and the decryption key k = (a, b)

aMODnOrderFinder

Give it the number for n, it prints out all the orders of a mod n that exist (satisfy gcd(a, n)=1), and tells you the primitive roots.

birthdayParadoxProbs

Finds probability of no birthday collisions for t people, for single t or range.

charstats

Feed it a string, it will give you the frequency of each letter as percentages.

extendedEuclid

Feed it two numbers, a and b. I think a should be bigger than b, but I am just working off two examples given to me, not the proofs. It does the Extended Euclid algorithm, and finds the mutual multiplicative inverses.

hashCollisionProbApprox

Finds probability of no collisions for hash function using function e^-(sum(1 -> t-1) / 365) (birthday paradox, so 2^n is 365)

millerRabinsSMPrimality

Primality tester: Uses Miller Rabins and Square Multiply to check if a number is a prime liar.
Threaded

modexp

Solves for x for equations in the format:
a^x = b mod c

phifinder

Find all integers n between 0 ≤ n < m that are relatively prime to m.
Euler’s phi function

streamCipherOne

To solve this:
Develop a scheme which operates with the letters A, B,..., Z, represented by the numbers 0,1,...,25.

About

Scripts to do the math for my homework. Some were actual homework.

License:Apache License 2.0


Languages

Language:Python 100.0%