Coder Social home page Coder Social logo

group-modulo-p's Introduction

Class ModuloP

General info

The main subject of this project is group Zp. This is an arithmetic on natural numbers modulo p, where p is a prime number. So, all calculations are done on the numbers {0,1,2,...,p-1}.
Let's assume that p = 11 (it's easy to change in library.hpp -> const int modulo_integer).
For example in Zp for p = 11:

  • 5+9 = 3
  • 5-9 = 7
  • 5*9 = 1
  • 5/9 = 3
    and the last operator is defined: a/b = a * c, where c is an inverse element. It means that a * c = 1 mod p. In our case 9 * 5 = 45 = 1 mod 11 so 5/9 = 5 * 5 = 25 = 3mod(11)

Class Description

Class has implemented following operators:

  • binary: + and - and * and unary: -
  • comparison: < and <= and > andd => and != and ==
  • stream: << and >>

RUN

  1. cmake -> Makefile
  2. make -> executable file

Motivation

Finding the inverse element is useful in RSA protocol. General scheme of RSA:

  • fix two diffrent number p,q -> n = p * q
  • m = phi(n) = (p-1)(q-1) where phi is the Euler totient function
  • find the number d such that gcd(d,m) = 1
  • find the number e such that d * e = 1 mod m
    -> e is an invert element to d and main.cpp finds it
  • next p,q,m should be forget and the PRIVATE KEY: (d,n) and PUBLIC KEY: (e,n)
  • encoding and decoding function:

group-modulo-p's People

Contributors

sebsr avatar

Watchers

 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.