Git Product home page Git Product logo

rabin-cryptosystem's Introduction

rabin-cryptosystem

Haskell implementation of Rabin's Public Key Cryptosystem, written for the Public Key Cryptography course @ Babes-Bolyai University, Cluj-Napoca

Prerequisites

  • GHC >= 9.6
  • cabal >= 3.10

(Both can be installed via ghcup)

Installing & Running

To install the project, simply run cabal install. Afterwards, you can simply run it as rabin.

If you don't want to install it, you can run it locally using the provided run.sh script.

CLI Interface

rabin gen-priv-key [--bits N] # Writes the binary-encoded private key to stdout. Defaults to 256 bits
rabin gen-pub-key # Reads the private key from stdin, writes the public key to stdout
rabin encrypt --pub-key PATH # Reads the plaintext message from stdin, writes the ciphertext to stdout
rabin decrypt --priv-key PATH # Reads the ciphertext from stdin, writes the cypheretext to stdout

If you haven't installed the project, use ./run.sh instead of rabin.

Example usage

# Generate private/public key pair
rabin gen-priv-key >a.key
rabin gen-pub-key <a.key >a.pub

# Encrypt a file, e.g. an image
rabin encrypt --pub-key a.pub <image.png >image.enc
rabin decrypt --priv-key a.key <image.enc >decrypted.png

Security Notice

Aside from the Rabin cryptosystem's known weaknesses, the implementation may also be vulnerable to timing attacks or other exploits.

Do not use this for security-critical systems.

License

This repository is licensed under the terms of the GNU General Public License v3. For more details, see the license file.

rabin-cryptosystem's People

Contributors

aionescu 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.