Code Monkey home page Code Monkey logo

cryptography's Introduction

Cryptography

This contains various implementation of cryptography algorithms and solutions.

Wieners-Attack:

Simple demonstration of the Wiener's Attack, and against against the RSA encryption

Vigenere:

Implementation of the Vigenere Algorithm without key. Needs modification in order to be used for different texts. Functions: find_letter(arg): Corresponds the number given as an argument to a letter. find_number(arg): Opposite of find_letter, corresponds the letter given as an argument to a number. def given_frequency(arg): Returns the frequency of a number. This is a standard number. #1 Finding the key length We count the coincidences and the number after which notive reoccurance or a pattern, is the key length. In this scenario, that number is 7. Although the number can be found, for now the number is passed hardcoded. For othertexts, this value needs to change.

Tonelli-Shanks

Script that finds the modular square root of two numbers. The script follows the Tonelli-Shanks algorithm which is widely used in cryptography. Function pow1: Function gcd: Recursice function that finds the gcd between two numbers. Function order: Returns a number k such that b^k = 1 (mod p) Function convertx2e: Function STonelli: This function acts like th 'main' would in Java,C++ etc. It makes sure that all the nesessary conditions are met in ordetr for the rest of the functions to be called.

Password Strength

Script in python that checks the strength of a given password checkWordList : make sure that the pws does not contain a word that belongs in a predefined list ( most word in the list are common words ) checkNumb : make sure that the pwd contains at least one number checkSpelChars : make sure the pwd contains at least one special character testLength : make sure the length is over 8 chars

DivisorCheck->possibility.py

This program finds the possibility of a number with bit length n, having a integer divisor d with bit length betweet [n/2-1,n2+1]

The implementation is quite is and the main goal of this script is the familiarity with finding the divisors of a number.

The script consists of two parts. First, finding the divisors of a given number, and second the percentage of those divisors, whose value is between (n/2)-1 and (n/2)+1 where n is the bt=it length of the given number.

The function divisors(arg) is responsible for the first part. By simply checking whether the number mod i( = every number between one and n) equals to zero, and then appening an array which by the end will include all the divisors ( including 1 -> if that's not desired, change the range of the loop from range(1,m) to range(2,m) ).

Second to last, there's a counter that measures the numbers in the divisors array that are within the limits set earlier. Last but not lest, this number is divided by the total length of the array and we have the percentage.

cryptography's People

Contributors

angzosan avatar annagzosan avatar

Watchers

 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.