Coder Social home page Coder Social logo

keycrypt's Introduction

keycrypt

keycrypt is a wrapper for generating SSH Keys and then encrypting them with OpenSSL. keycrypt offers other features like copying the pubkey from your local machine to a remote host. This can even be done as part of the create step!

Current Features

  • SSH Key Creation
  • SSH Key Encryption with OpenSSL
  • Copying PubKey to Remote Server (similar to ssh-copy-id)

Future Features

  • Improved PubKey Copying
  • Scanning for unencrypted keys and prompting for encryption

Why would I need this?

The default encryption that ships with SSH isn't the most secure, it comprises of the following:

The header tells us the encryption algorithm that was used: AES-128 in CBC mode. The 128-bit hex string in the DEK-Info header is the initialization vector (IV) for the cipher. This is pretty standard stuff; all common crypto libraries can handle it.

Martin Kleppmann has show below that there are two primary weaknesses in the way SSH encrypts it's keys:

  • The digest algorithm is hard-coded to be MD5, which means that without changing the format, it’s not possible to upgrade to another hash function (e.g. SHA-1). This could be a problem if MD5 turns out not to be good enough.
  • The hash function is only applied once β€” there is no stretching. This is a problem because MD5 and AES are both fast to compute, and thus a short passphrase is quite easy to break with brute force.

From this it was devised that we could get a higher level of security from using OpenSSL. As such I wanted to automate the process of creating an SSH key and then encrypting it with OpenSSL, and keycrypt was born.


Credits

This idea was fostered from an article written by Martin Kleppmann

keycrypt's People

Contributors

aljce avatar andrewkro avatar brendanthompson avatar nzrq avatar pacohope avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keycrypt's Issues

Allow for Automated Key Copy

Have a secondary function that doesn't prompt for in put, merely takes input so that it can be used in a scripted fashion.

Check OS type

Check for the OS type in the defaultKeyLocation function, and chose the default dependent on that.

Key Analysis

Need to add an option to look at the existing keys, check to see if these are encrypted. If not do you want to encrypt some of them or all of them. If they are already encrypted then offer to exit or offer to re-encrypt them.

A few suggestions

Thanks for the script!

Here are a few suggestions:
1> /dev/null should be > /dev/null
Otherwise, there is an error when running on MacOS.

Include correct email in key. Add the following in createKey():
KNAME=$(basename $KEY)
grep -q '@' <<< $KNAME || KNAME=$KNAME@$HOSTNAME
KEYEMAIL="-C $KNAME"

    COMMAND="$COMMAND $TYPE $BITS $KEYEMAIL $OUTPUT_DIR $PASS"

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.