Skip to content

jeffgran/krs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

A Rust Cryptography Toy

This is just a little toy command line program I wrote while taking Coursera Cryptography classes. I implemented some helper functions based on algorithms we learned (square-and-multiply for fast exponentiation, modular exponentiation without overflowing integers, raw RSA math, etc).

Here's what it looks like:

$ krs
krs 0.1.0
Jeff Gran <jeff.gran@gmail.com>
crypto.rs -- A Cryptography/Math CLI Library

USAGE:
    krs <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    gcd        Returns the greatest common divisor of two numbers <a> and <b>
    help       Prints this message or the help of the given subcommand(s)
    isdiv      Is <a> evenly divisible by <b>?
    isfmt      Is the number probably prime (per Fermat)?
    isprime    Is the number prime?
    mi         What is the multiplicative inverse of <a> mod <n> (if it exists)?
    mpow       Modular Exponentiation, i.e. a^b(mod n)
    rsae       RSA encrypt integer 'message'

$ krs help mi
Usage: krs mi <a> <n>

$ krs mi 14 53
Some(19)

$ krs mi 6 18
None

About

A CLI toy program with an assortment of cryptography-related helper functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages