Code Monkey home page Code Monkey logo

crypto-library's Introduction

This is a list of cryptographic functions written in python for my CSI 426 class at UAlbany. This interactive program allows you to chose from the following working functions:
Prime Factorization- Three different methods are available.
	1)Brute force prime factorization will provide you  with a list of prime factors, however it is the slowest because it simply checks all numbers to see if they are part of the factorization.
	2)Fermat's factorization will allow you to factor a composite number that is the product of two primes that are fairly close to each other.
	3)Rho Factorization uses a probabilistic approach. It uses a user inputted seed. This method can fail in which case you simply enter a new seed and try again. Eventually you will get two factors assuming your number is a factorable number.


	
Exponentiation using Russian Peasant Algorithm, which uses squaring and halving modulo p to achieve exponentiation


Extended Euclidean Greatest Common Denominator Algorithm which will return the greatest common denominator between two numbers as well as the inverse of both with respect to the other. 

Miller Rabin method of primality testing, which uses a probabilistic approach to determine if a number is a prime number. Miller Rabin is particularly good at dealing with Carmichael Numbers.

Discrete Logarithm done using Baby-step, Giant-step algorithm. Pohlig-Hellman is a possibility for a new logarithm function.

An Elliptical Curve class, that will create an elliptical curve given the user input of a, b and a prime. The prime can be 0 if you wish to create the curve over the real number field. The following functions are available once you create your elliptical curve:
1) Print Curve will print the current curve in the form x^3+ax+b
2) Evaluate point will evluvate a point on the curve given an x-coordinate.
3) Point Addition will add two points within the curve. The user must input two points for this to work. If you only have 1 point, you must select point doubling option. 
4) Point Doubling will calculate 2p given p. Note that doing this again with 2p will provide 4p. If you want an odd doubling you must, add p to the current doubled p. Factorization is also done automatically if you have a composite modulus.
5) Factor using elliptical curve. This function will take in an x,y coordinate and produce a factor for the modulous, if said modulous is a composite one. If the number is prime, you will have in infinite loop.

crypto-library's People

Contributors

covertskippy55 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.